v0.15.0
Loading...
Searching...
No Matches
EshelbianPlasticity::OpBrokenTractionBc Struct Reference

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

Inheritance diagram for EshelbianPlasticity::OpBrokenTractionBc:
[legend]
Collaboration diagram for EshelbianPlasticity::OpBrokenTractionBc:
[legend]

Public Member Functions

 OpBrokenTractionBc (const std::string row_field, boost::shared_ptr< TractionBcVec > bc_data, boost::shared_ptr< double > piola_scale_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
 
MoFEMErrorCode iNtegrate (EntData &data)
 

Protected Attributes

boost::shared_ptr< TractionBcVecbcData
 
boost::shared_ptr< doublepiolaScalePtr
 
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
 

Detailed Description

Definition at line 489 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpBrokenTractionBc()

EshelbianPlasticity::OpBrokenTractionBc::OpBrokenTractionBc ( const std::string row_field,
boost::shared_ptr< TractionBcVec > bc_data,
boost::shared_ptr< double > piola_scale_ptr,
std::map< std::string, boost::shared_ptr< ScalingMethod > > smv )
inline

Definition at line 491 of file EshelbianPlasticity.hpp.

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpBrokenTractionBc::iNtegrate ( EntData & data)
Examples
EshelbianOperators.cpp.

Definition at line 1911 of file EshelbianOperators.cpp.

1911 {
1913
1914 FTENSOR_INDEX(3, i);
1915
1916 int nb_dofs = data.getFieldData().size();
1917 int nb_integration_pts = getGaussPts().size2();
1918 int nb_base_functions = data.getN().size2();
1919
1920 double time = getFEMethod()->ts_t;
1923 }
1924
1925#ifndef NDEBUG
1926 if (this->locF.size() != nb_dofs)
1927 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1928 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
1929#endif // NDEBUG
1930
1931 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
1933
1934 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
1935 auto t_row_base = data.getFTensor0N();
1936 auto t_w = getFTensor0IntegrationWeight();
1937 auto t_coords = getFTensor1CoordsAtGaussPts();
1938
1939 double scale = (piolaScalePtr) ? 1. / (*piolaScalePtr) : 1.0;
1940
1941 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1942
1943 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
1944 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
1945 int rr = 0;
1946 for (; rr != nb_dofs / SPACE_DIM; ++rr) {
1947 t_f(i) -= (time_scale * t_w * t_row_base * tau) * (t_val(i) * scale);
1948 ++t_row_base;
1949 ++t_f;
1950 }
1951
1952 for (; rr != nb_base_functions; ++rr)
1953 ++t_row_base;
1954 ++t_w;
1955 ++t_coords;
1956 }
1957 this->locF *= getMeasure();
1959 };
1960
1961 // get entity of face
1962 EntityHandle fe_ent = getFEEntityHandle();
1963 for (auto &bc : *(bcData)) {
1964 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1965
1966 double time_scale = 1;
1967 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
1968 time_scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
1969 }
1970
1971 int nb_dofs = data.getFieldData().size();
1972 if (nb_dofs) {
1973
1974 if (std::regex_match(bc.blockName, std::regex(".*COOK.*"))) {
1975 auto calc_tau = [](double, double y, double) {
1976 y -= 44;
1977 y /= (60 - 44);
1978 return -y * (y - 1) / 0.25;
1979 };
1980 CHKERR integrate_rhs(bc, calc_tau, time_scale);
1981 } else {
1982 CHKERR integrate_rhs(
1983 bc, [](double, double, double) { return 1; }, time_scale);
1984 }
1985 }
1986 }
1987 }
1989}
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Tensor1< FTensor::PackPtr< double *, S >, DIM > getFTensor1FromPtr(double *ptr)
Make Tensor1 from pointer.
double scale
Definition plastic.cpp:123
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< TractionBcVec > bcData
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorDouble & getFieldData() const
get dofs values

Member Data Documentation

◆ bcData

boost::shared_ptr<TractionBcVec> EshelbianPlasticity::OpBrokenTractionBc::bcData
protected
Examples
EshelbianOperators.cpp.

Definition at line 502 of file EshelbianPlasticity.hpp.

◆ piolaScalePtr

boost::shared_ptr<double> EshelbianPlasticity::OpBrokenTractionBc::piolaScalePtr
protected
Examples
EshelbianOperators.cpp.

Definition at line 503 of file EshelbianPlasticity.hpp.

◆ scalingMethodsMap

std::map<std::string, boost::shared_ptr<ScalingMethod> > EshelbianPlasticity::OpBrokenTractionBc::scalingMethodsMap
protected
Examples
EshelbianOperators.cpp.

Definition at line 504 of file EshelbianPlasticity.hpp.


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