v0.10.0
Public Member Functions | Private Attributes | List of all members
OpElasticTools::OpEssentialRHS_U Struct Reference

#include <users_modules/multifield_plasticity/src/ElasticOperators.hpp>

Inheritance diagram for OpElasticTools::OpEssentialRHS_U:
[legend]
Collaboration diagram for OpElasticTools::OpEssentialRHS_U:
[legend]

Public Member Functions

 OpEssentialRHS_U (std::string disp_name, boost::shared_ptr< CommonData > common_data_ptr, size_t comp, VectorDouble &disp, const Range &essential_ents)
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
- Public Member Functions inherited from MoFEM::EdgeElementForcesAndSourcesCoreBase::UserDataOperator
const EntityHandlegetConn ()
 get element connectivity More...
 
double getLength ()
 get edge length More...
 
double getMeasure ()
 get measure of element More...
 
VectorDoublegetDirection ()
 get edge direction More...
 
VectorDoublegetCoords ()
 get edge node coordinates More...
 
MatrixDoublegetCoordsAtGaussPts ()
 get coordinate at integration point More...
 
auto getFTensor1CoordsAtGaussPts ()
 get coordinates at Gauss pts. More...
 
MatrixDoublegetTangetAtGaussPts ()
 get tangent vector to edge curve at integration points More...
 
const EdgeElementForcesAndSourcesCoreBasegetEdgeFE ()
 get pointer to this finite element More...
 
FTensor::Tensor1< double, 3 > getFTensor1Direction ()
 
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getTensor1Coords ()
 get get coords at gauss points More...
 
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1TangentAtGaussPts ()
 
template<int SWITCH>
MoFEMErrorCode loopSideFaces (const string &fe_name, FaceElementForcesAndSourcesCoreOnSideSwitch< SWITCH > &fe_side)
 
- Public Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
 UserDataOperator (const FieldSpace space, const char type=OPLAST, const bool symm=true)
 
 UserDataOperator (const std::string &field_name, const char type, const bool symm=true)
 
 UserDataOperator (const std::string &row_field_name, const std::string &col_field_name, const char type, const bool symm=true)
 
boost::shared_ptr< const NumeredEntFiniteElementgetNumeredEntFiniteElementPtr () const
 Return raw pointer to NumeredEntFiniteElement. More...
 
EntityHandle getFEEntityHandle () const
 Return finite element entity handle. More...
 
boost::weak_ptr< SideNumber > getSideNumberPtr (const int side_number, const EntityType type)
 Get the side number pointer. More...
 
EntityHandle getSideEntity (const int side_number, const EntityType type)
 Get the side entity. More...
 
int getNumberOfNodesOnElement ()
 Get the number of nodes on finite element. More...
 
MoFEMErrorCode getProblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get row indices. More...
 
MoFEMErrorCode getProblemColIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get col indices. More...
 
const FEMethodgetFEMethod () const
 Return raw pointer to Finite Element Method object. More...
 
int getOpType () const
 Get operator types. More...
 
void setOpType (const OpType type)
 Set operator type. More...
 
void addOpType (const OpType type)
 Add operator type. More...
 
int getNinTheLoop () const
 get number of finite element in the loop More...
 
int getLoopSize () const
 get size of elements in the loop More...
 
const std::string & getFEName () const
 Get name of the element. More...
 
const PetscData::SwitchesgetDataCtx () const
 
const KspMethod::KSPContext getKSPCtx () const
 
const SnesMethod::SNESContext getSNESCtx () const
 
const TSMethod::TSContext getTSCtx () const
 
Vec getKSPf () const
 
Mat getKSPA () const
 
Mat getKSPB () const
 
Vec getSNESf () const
 
Vec getSNESx () const
 
Mat getSNESA () const
 
Mat getSNESB () const
 
DEPRECATED Vec getSnesF () const
 
DEPRECATED Vec getSnesX () const
 
DEPRECATED Mat getSnesA () const
 
DEPRECATED Mat getSnesB () const
 
Vec getTSu () const
 
Vec getTSu_t () const
 
Vec getTSu_tt () const
 
Vec getTSf () const
 
Mat getTSA () const
 
Mat getTSB () const
 
int getTSstep () const
 
double getTStime () const
 
double getTSa () const
 
MatrixDoublegetGaussPts ()
 matrix of integration (Gauss) points for Volume Element More...
 
auto getFTensor0IntegrationWeight ()
 Get integration weights. More...
 
DEPRECATED MoFEMErrorCode getPorblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 
- Public Member Functions inherited from MoFEM::DataOperator
 DataOperator (const bool symm=true)
 
virtual ~DataOperator ()=default
 
virtual MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on left hand side. More...
 
virtual MoFEMErrorCode opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data)
 
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool error_if_no_base=false)
 
bool getSymm () const
 Get if operator uses symmetry of DOFs or not. More...
 
void setSymm ()
 set if operator is executed taking in account symmetry More...
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem More...
 

Private Attributes

VectorDouble locRes
 
size_t cOmp
 
boost::shared_ptr< CommonDatacommonDataPtr
 
VectorDouble & disP
 
Range essentialEnts
 

Additional Inherited Members

- Public Types inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
enum  OpType { OPROW = 1 << 0, OPCOL = 1 << 1, OPROWCOL = 1 << 2, OPLAST = 1 << 3 }
 Controls loop over entities on element. More...
 
- Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
char opType
 
std::string rowFieldName
 
std::string colFieldName
 
FieldSpace sPace
 
- Public Attributes inherited from MoFEM::DataOperator
bool sYmm
 If true assume that matrix is symmetric structure. More...
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity. More...
 
booldoVertices
 \deprectaed If false skip vertices More...
 
booldoEdges
 \deprectaed If false skip edges More...
 
booldoQuads
 \deprectaed More...
 
booldoTris
 \deprectaed More...
 
booldoTets
 \deprectaed More...
 
booldoPrisms
 \deprectaed More...
 
- Protected Member Functions inherited from MoFEM::EdgeElementForcesAndSourcesCoreBase::UserDataOperator
MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
- Protected Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoregetPtrFE () const
 
ForcesAndSourcesCoregetSidePtrFE () const
 
- Protected Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 

Detailed Description

Definition at line 1007 of file ElasticOperators.hpp.

Constructor & Destructor Documentation

◆ OpEssentialRHS_U()

OpElasticTools::OpEssentialRHS_U::OpEssentialRHS_U ( std::string  disp_name,
boost::shared_ptr< CommonData common_data_ptr,
size_t  comp,
VectorDouble &  disp,
const Range &  essential_ents 
)

Definition at line 1008 of file ElasticOperators.hpp.

1011  : BoundaryEleOp(disp_name, BoundaryEleOp::OPROW),
1012  essentialEnts(essential_ents), cOmp(comp), disP(disp),
1013  commonDataPtr(common_data_ptr) {}
boost::shared_ptr< CommonData > commonDataPtr
BoundaryEle::UserDataOperator BoundaryEleOp

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpElasticTools::OpEssentialRHS_U::doWork ( int  side,
EntityType  type,
EntData data 
)
virtual

Operator for linear form, usually to calculate values on right hand side.

Reimplemented from MoFEM::DataOperator.

Definition at line 1015 of file ElasticOperators.hpp.

1015  {
1017  const int nb_row_dofs = row_data.getIndices().size();
1018 
1019  if (nb_row_dofs) {
1020 
1022  if (essentialEnts.find(ent) == essentialEnts.end()) {
1024  }
1025 
1026  auto get_tensor1 = [](VectorDouble &m, const int r) {
1027  return FTensor::Tensor1<double *, 3>(&m(r + 0), &m(r + 1), &m(r + 2));
1028  };
1029 
1030  auto t_dispValue = getFTensor1FromMat<3>(*commonDataPtr->contactDispPtr);
1031 
1032  locRes.resize(nb_row_dofs, false);
1033  locRes.clear();
1034 
1035  const int nb_integration_pts = getGaussPts().size2();
1036  auto t_row_val = row_data.getFTensor0N();
1037  auto t_w = getFTensor0IntegrationWeight();
1038  const double vol = getMeasure();
1039 
1040  for (int gg = 0; gg != nb_integration_pts; ++gg) {
1041  const double a = vol * t_w;
1042 
1043  for (int rr = 0; rr != nb_row_dofs / 3; ++rr) {
1044  auto t_subLocRes = get_tensor1(locRes, 3 * rr);
1045  t_subLocRes(cOmp) += a * t_row_val * (t_dispValue(cOmp) - disP(0));
1046  ++t_row_val;
1047  }
1048  ++t_dispValue;
1049  ++t_w;
1050  }
1051 
1052  CHKERR VecSetValues(getFEMethod()->ts_F, row_data, &*locRes.begin(),
1053  ADD_VALUES);
1054  }
1056  }
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
boost::shared_ptr< CommonData > commonDataPtr
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
static Index< 'm', 3 > m
auto getFTensor0IntegrationWeight()
Get integration weights.
EntityHandle getFEEntityHandle() const
Return finite element entity handle.
#define CHKERR
Inline error check.
Definition: definitions.h:604
const double r
rate factor
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Types.hpp:74

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<CommonData> OpElasticTools::OpEssentialRHS_U::commonDataPtr
private

Definition at line 1061 of file ElasticOperators.hpp.

◆ cOmp

size_t OpElasticTools::OpEssentialRHS_U::cOmp
private

Definition at line 1060 of file ElasticOperators.hpp.

◆ disP

VectorDouble& OpElasticTools::OpEssentialRHS_U::disP
private

Definition at line 1062 of file ElasticOperators.hpp.

◆ essentialEnts

Range OpElasticTools::OpEssentialRHS_U::essentialEnts
private

Definition at line 1063 of file ElasticOperators.hpp.

◆ locRes

VectorDouble OpElasticTools::OpEssentialRHS_U::locRes
private

Definition at line 1059 of file ElasticOperators.hpp.


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