v0.15.4
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
OpBrokenTractionBc Struct Reference

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

Inheritance diagram for OpBrokenTractionBc:
[legend]
Collaboration diagram for 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< TractionBcVec > bcData
 
boost::shared_ptr< doublepiolaScalePtr
 
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
 

Detailed Description

Examples
/home/lk58p/mofem_install/vanilla_dev_release/mofem-cephas/mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianPlasticity.cpp.

Definition at line 481 of file EshelbianOperators.hpp.

Constructor & Destructor Documentation

◆ OpBrokenTractionBc()

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 483 of file EshelbianOperators.hpp.

487 : FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase(
488 row_field, row_field, FaceUserDataOperator::OPROW),
489 bcData(bc_data), piolaScalePtr(), scalingMethodsMap(smv) {}
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< double > piolaScalePtr
boost::shared_ptr< TractionBcVec > bcData

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpBrokenTractionBc::iNtegrate ( EntData data)
Examples
mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp.

Definition at line 1889 of file EshelbianOperators.cpp.

1889 {
1891
1892 FTENSOR_INDEX(3, i);
1893
1894 int nb_dofs = data.getFieldData().size();
1895 int nb_integration_pts = getGaussPts().size2();
1896 int nb_base_functions = data.getN().size2();
1897
1898 double time = getFEMethod()->ts_t;
1901 }
1902
1903#ifndef NDEBUG
1904 if (this->locF.size() != nb_dofs)
1905 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1906 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
1907#endif // NDEBUG
1908
1909 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
1911
1912 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
1913 auto t_row_base = data.getFTensor0N();
1914 auto t_w = getFTensor0IntegrationWeight();
1915 auto t_coords = getFTensor1CoordsAtGaussPts();
1916
1917 double scale = (piolaScalePtr) ? 1. / (*piolaScalePtr) : 1.0;
1918
1919 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1920
1921 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
1922 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
1923 int rr = 0;
1924 for (; rr != nb_dofs / SPACE_DIM; ++rr) {
1925 t_f(i) -= (time_scale * t_w * t_row_base * tau) * (t_val(i) * scale);
1926 ++t_row_base;
1927 ++t_f;
1928 }
1929
1930 for (; rr != nb_base_functions; ++rr)
1931 ++t_row_base;
1932 ++t_w;
1933 ++t_coords;
1934 }
1935 this->locF *= getMeasure();
1937 };
1938
1939 // get entity of face
1940 EntityHandle fe_ent = getFEEntityHandle();
1941 for (auto &bc : *(bcData)) {
1942 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1943
1944 double time_scale = 1;
1945 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
1946 time_scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
1947 }
1948
1949 int nb_dofs = data.getFieldData().size();
1950 if (nb_dofs) {
1951
1952 if (std::regex_match(bc.blockName, std::regex(".*COOK.*"))) {
1953 auto calc_tau = [](double, double y, double) {
1954 y -= 44;
1955 y /= (60 - 44);
1956 return -y * (y - 1) / 0.25;
1957 };
1958 CHKERR integrate_rhs(bc, calc_tau, time_scale);
1959 } else {
1960 CHKERR integrate_rhs(
1961 bc, [](double, double, double) { return 1; }, time_scale);
1962 }
1963 }
1964 }
1965 }
1967}
#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
static double dynamicTime
static PetscBool dynamicRelaxation
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 DOF values on entity.
double scale
Definition plastic.cpp:123

Member Data Documentation

◆ bcData

boost::shared_ptr<TractionBcVec> OpBrokenTractionBc::bcData
protected

Definition at line 494 of file EshelbianOperators.hpp.

◆ piolaScalePtr

boost::shared_ptr<double> OpBrokenTractionBc::piolaScalePtr
protected

Definition at line 495 of file EshelbianOperators.hpp.

◆ scalingMethodsMap

std::map<std::string, boost::shared_ptr<ScalingMethod> > OpBrokenTractionBc::scalingMethodsMap
protected

Definition at line 496 of file EshelbianOperators.hpp.


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