v0.16.0
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 471 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 473 of file EshelbianOperators.hpp.

477 : FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase(
478 row_field, row_field, FaceUserDataOperator::OPROW),
479 bcData(bc_data), piolaScalePtr(piola_scale_ptr), 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
/home/lk58p/mofem_install/vanilla_dev_release/mofem-cephas/mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp.

Definition at line 2133 of file EshelbianOperators.cpp.

2133 {
2135
2136 FTENSOR_INDEX(3, i);
2137
2138 int nb_dofs = data.getFieldData().size();
2139 int nb_integration_pts = getGaussPts().size2();
2140 int nb_base_functions = data.getN().size2();
2141
2142 double time = getFEMethod()->ts_t;
2145 }
2146
2147#ifndef NDEBUG
2148 if (this->locF.size() != nb_dofs)
2149 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
2150 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
2151#endif // NDEBUG
2152
2153 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
2155
2156 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
2157 auto t_row_base = data.getFTensor0N();
2158 auto t_w = getFTensor0IntegrationWeight();
2159 auto t_coords = getFTensor1CoordsAtGaussPts();
2160 auto t_normal = getFTensor1NormalsAtGaussPts();
2161
2162 double scale = (piolaScalePtr) ? 1. / (*piolaScalePtr) : 1.0;
2163
2164 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2165
2166 double a = sqrt(t_normal(i) * t_normal(i));
2167 a /= 2.;
2168 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2169 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
2170 int rr = 0;
2171 for (; rr != nb_dofs / SPACE_DIM; ++rr) {
2172 t_f(i) -=
2173 (time_scale * a * t_w * t_row_base * tau) * (t_val(i) * scale);
2174 ++t_row_base;
2175 ++t_f;
2176 }
2177
2178 for (; rr != nb_base_functions; ++rr)
2179 ++t_row_base;
2180 ++t_w;
2181 ++t_coords;
2182 ++t_normal;
2183 }
2185 };
2186
2187 // get entity of face
2188 EntityHandle fe_ent = getFEEntityHandle();
2189 for (auto &bc : *(bcData)) {
2190 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2191
2192 double time_scale = 1;
2193 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
2194 time_scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
2195 }
2196
2197 int nb_dofs = data.getFieldData().size();
2198 if (nb_dofs) {
2199
2200 if (std::regex_match(bc.blockName, std::regex(".*COOK.*"))) {
2201 auto calc_tau = [](double, double y, double) {
2202 y -= 44;
2203 y /= (60 - 44);
2204 return -y * (y - 1) / 0.25;
2205 };
2206 CHKERR integrate_rhs(bc, calc_tau, time_scale);
2207 } else {
2208 CHKERR integrate_rhs(
2209 bc, [](double, double, double) { return 1; }, time_scale);
2210 }
2211 }
2212 }
2213 }
2215}
#define FTENSOR_INDEX(DIM, I)
constexpr double a
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 PetscBool physicalTimeFlg
static double currentPhysicalTime
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:124

Member Data Documentation

◆ bcData

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

Definition at line 484 of file EshelbianOperators.hpp.

◆ piolaScalePtr

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

Definition at line 485 of file EshelbianOperators.hpp.

◆ scalingMethodsMap

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

Definition at line 486 of file EshelbianOperators.hpp.


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