v0.15.0
Loading...
Searching...
No Matches
EshelbianPlasticity::OpRotationBcImpl< A, GAUSS > Struct Template Reference

#include "users_modules/eshelbian_plasticity/src/EshelbianPlasticity.hpp"

Inheritance diagram for EshelbianPlasticity::OpRotationBcImpl< A, GAUSS >:
[legend]
Collaboration diagram for EshelbianPlasticity::OpRotationBcImpl< A, GAUSS >:
[legend]

Public Types

using OP
 

Public Member Functions

 OpRotationBcImpl (boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, boost::shared_ptr< BcRotVec > &bc_rot_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, boost::shared_ptr< Range > ents_ptr=nullptr)
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntData &data)
 

Protected Attributes

boost::shared_ptr< BcRotVecbcRotPtr
 
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
 

Detailed Description

template<AssemblyType A>
struct EshelbianPlasticity::OpRotationBcImpl< A, GAUSS >

Definition at line 451 of file EshelbianPlasticity.hpp.

Member Typedef Documentation

◆ OP

template<AssemblyType A>
using EshelbianPlasticity::OpRotationBcImpl< A, GAUSS >::OP
Initial value:
typename FormsIntegrators<FaceUserDataOperator>::Assembly<

Definition at line 454 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpRotationBcImpl()

template<AssemblyType A>
EshelbianPlasticity::OpRotationBcImpl< A, GAUSS >::OpRotationBcImpl ( boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data,
boost::shared_ptr< BcRotVec > & bc_rot_ptr,
std::map< std::string, boost::shared_ptr< ScalingMethod > > smv,
boost::shared_ptr< Range > ents_ptr = nullptr )
inline

Definition at line 457 of file EshelbianPlasticity.hpp.

462 {
463 return get_vecTensor3<0>(dependentVariablesPiolaDirevatives,

Member Function Documentation

◆ iNtegrate()

template<AssemblyType A>
MoFEMErrorCode OpRotationBcImpl< A, GAUSS >::iNtegrate ( EntData & data)
protected

Definition at line 1485 of file EshelbianOperators.cpp.

1485 {
1487
1488 FTENSOR_INDEX(3, i);
1489 FTENSOR_INDEX(3, j);
1490 FTENSOR_INDEX(3, k);
1491
1492 double time = OP::getFEMethod()->ts_t;
1495 }
1496
1497 // get entity of face
1498 EntityHandle fe_ent = OP::getFEEntityHandle();
1499 // interate over all boundary data
1500 for (auto &bc : (*bcRotPtr)) {
1501 // check if finite element entity is part of boundary condition
1502 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1503 int nb_dofs = data.getIndices().size();
1504 int nb_integration_pts = OP::getGaussPts().size2();
1505 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1506 auto t_w = OP::getFTensor0IntegrationWeight();
1507
1508 int nb_base_functions = data.getN().size2() / 3;
1509 auto t_row_base_fun = data.getFTensor1N<3>();
1510
1511 auto get_ftensor1 = [](auto &v) {
1513 &v[2]);
1514 };
1515
1516 // Note: First three values of bc.vals are the center of rotation
1517 // 4th is rotation angle in radians, and remaining values are axis of
1518 // rotation. Also, if rotation axis is not provided, it defaults to the
1519 // normal vector of the face.
1520
1521 // get bc data
1522 FTensor::Tensor1<double, 3> t_center(bc.vals[0], bc.vals[1], bc.vals[2]);
1523
1524 auto get_rotation_angle = [&]() {
1525 double theta = bc.theta;
1526 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
1527 theta *= scalingMethodsMap.at(bc.blockName)->getScale(time);
1528 }
1529 return theta;
1530 };
1531
1532 auto get_rotation = [&](auto theta) {
1534 if (bc.vals.size() == 7) {
1535 t_omega(0) = bc.vals[4];
1536 t_omega(1) = bc.vals[5];
1537 t_omega(2) = bc.vals[6];
1538 } else {
1539 // Use gemetric face normal as rotation axis
1540 t_omega(i) = OP::getFTensor1Normal()(i);
1541 }
1542 t_omega.normalize();
1543 t_omega(i) *= theta;
1546 ? 0.
1547 : t_omega.l2());
1548 };
1549
1550 auto t_R = get_rotation(get_rotation_angle());
1551 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
1552
1553 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1555 t_delta(i) = t_center(i) - t_coords(i);
1557 t_disp(i) = t_delta(i) - t_R(i, j) * t_delta(j);
1558
1559 auto t_nf = getFTensor1FromPtr<3>(&*OP::locF.begin());
1560 int bb = 0;
1561 for (; bb != nb_dofs / 3; ++bb) {
1562 t_nf(i) += t_w * (t_row_base_fun(j) * t_normal(j)) * t_disp(i) * 0.5;
1563 ++t_nf;
1564 ++t_row_base_fun;
1565 }
1566 for (; bb != nb_base_functions; ++bb)
1567 ++t_row_base_fun;
1568
1569 ++t_w;
1570 ++t_normal;
1571 ++t_coords;
1572 }
1573 }
1574 }
1576}
#define FTENSOR_INDEX(DIM, I)
Tensor1< T, Tensor_Dim > normalize()
#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 v
phase velocity of light in medium (cm/ns)
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
FTensor::Tensor1< FTensor::PackPtr< double *, S >, DIM > getFTensor1FromPtr(double *ptr)
Make Tensor1 from pointer.
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
static auto exp(A &&t_w_vee, B &&theta)
Definition Lie.hpp:48
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

◆ bcRotPtr

template<AssemblyType A>
boost::shared_ptr<BcRotVec> EshelbianPlasticity::OpRotationBcImpl< A, GAUSS >::bcRotPtr
protected

Definition at line 467 of file EshelbianPlasticity.hpp.

◆ scalingMethodsMap

template<AssemblyType A>
std::map<std::string, boost::shared_ptr<ScalingMethod> > EshelbianPlasticity::OpRotationBcImpl< A, GAUSS >::scalingMethodsMap
protected

Definition at line 468 of file EshelbianPlasticity.hpp.


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