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

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

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

Public Member Functions

 OpBoundaryMassMatrix_UU (std::string disp_name, size_t comp, const Range &essential_ents)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 Operator for bi-linear form, usually to calculate values on left 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 opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data)
 
virtual MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
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

MatrixDouble locMat
 
MatrixDouble locTransMat
 
Range essentialEnts
 
size_t cOmp
 

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 931 of file ElasticOperators.hpp.

Constructor & Destructor Documentation

◆ OpBoundaryMassMatrix_UU()

OpElasticTools::OpBoundaryMassMatrix_UU::OpBoundaryMassMatrix_UU ( std::string  disp_name,
size_t  comp,
const Range &  essential_ents 
)

Definition at line 932 of file ElasticOperators.hpp.

934  : BoundaryEleOp(disp_name, disp_name, BoundaryEleOp::OPROWCOL),
935  cOmp(comp), essentialEnts(essential_ents) {
936  sYmm = true;
937  }
bool sYmm
If true assume that matrix is symmetric structure.
BoundaryEle::UserDataOperator BoundaryEleOp

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpElasticTools::OpBoundaryMassMatrix_UU::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntData row_data,
EntData col_data 
)
virtual

Operator for bi-linear form, usually to calculate values on left hand side.

Reimplemented from MoFEM::DataOperator.

Definition at line 939 of file ElasticOperators.hpp.

941  {
943  const int nb_row_dofs = row_data.getIndices().size();
944  const int nb_col_dofs = col_data.getIndices().size();
945 
946  if (nb_row_dofs && nb_col_dofs) {
947 
949  if (essentialEnts.find(ent) == essentialEnts.end()) {
951  }
952 
953  auto get_tensor3 = [](MatrixDouble &m, const int r, const int c) {
955  &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2),
956  &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2),
957  &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2));
958  };
959 
960  locMat.resize(nb_row_dofs, nb_col_dofs, false);
961  locMat.clear();
962 
963  const int nb_integration_pts = getGaussPts().size2();
964 
965  auto t_row_val = row_data.getFTensor0N();
966 
967  auto t_w = getFTensor0IntegrationWeight();
968  const double vol = getMeasure();
969 
970  for (int gg = 0; gg != nb_integration_pts; ++gg) {
971  const double a = vol * t_w;
972 
973  for (int rr = 0; rr != nb_row_dofs / 3; ++rr) {
974 
975  auto t_col_val = col_data.getFTensor0N(gg, 0);
976 
977  for (int cc = 0; cc != nb_col_dofs / 3; ++cc) {
978  auto t_subLocMat = get_tensor3(locMat, 3 * rr, 3 * cc);
979  t_subLocMat(cOmp, cOmp) += (a * t_row_val * t_col_val);
980 
981  ++t_col_val;
982  }
983  ++t_row_val;
984  }
985  ++t_w;
986  }
987 
988  CHKERR MatSetValues(getFEMethod()->ts_B, row_data, col_data,
989  &locMat(0, 0), ADD_VALUES);
990 
991  if (row_side != col_side || row_type != col_type) {
992  locTransMat.resize(nb_col_dofs, nb_row_dofs, false);
993  noalias(locTransMat) = trans(locMat);
994  CHKERR MatSetValues(getFEMethod()->ts_B, col_data, row_data,
995  &locTransMat(0, 0), ADD_VALUES);
996  }
997  }
999  }
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:76
#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.
const VectorInt & getIndices() const
Get global indices of dofs on entity.
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
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.

Member Data Documentation

◆ cOmp

size_t OpElasticTools::OpBoundaryMassMatrix_UU::cOmp
private

Definition at line 1004 of file ElasticOperators.hpp.

◆ essentialEnts

Range OpElasticTools::OpBoundaryMassMatrix_UU::essentialEnts
private

Definition at line 1003 of file ElasticOperators.hpp.

◆ locMat

MatrixDouble OpElasticTools::OpBoundaryMassMatrix_UU::locMat
private

Definition at line 1002 of file ElasticOperators.hpp.

◆ locTransMat

MatrixDouble OpElasticTools::OpBoundaryMassMatrix_UU::locTransMat
private

Definition at line 1002 of file ElasticOperators.hpp.


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