v0.13.2
Loading...
Searching...
No Matches
Protected Member Functions | List of all members
MoFEM::OpBaseImpl< USER_ASSEMBLE, EleOp > Struct Template Reference

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

Inheritance diagram for MoFEM::OpBaseImpl< USER_ASSEMBLE, EleOp >:
[legend]
Collaboration diagram for MoFEM::OpBaseImpl< USER_ASSEMBLE, EleOp >:
[legend]

Protected Member Functions

MoFEMErrorCode aSsemble (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data, const bool transpose)
 
MoFEMErrorCode aSsemble (EntitiesFieldData::EntData &data)
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< LAST_ASSEMBLE, EleOp >
FTensor::Tensor1< FTensor::PackPtr< double *, DIM >, DIM > getNf ()
 
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 
virtual MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrate grad-grad operator. More...
 
virtual MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 

Additional Inherited Members

- Public Types inherited from MoFEM::OpBaseImpl< LAST_ASSEMBLE, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 
- Public Member Functions inherited from MoFEM::OpBaseImpl< LAST_ASSEMBLE, EleOp >
 OpBaseImpl (const std::string row_field_name, const std::string col_field_name, const OpType type, boost::shared_ptr< Range > ents_ptr=nullptr)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 Do calculations for the left hand side. More...
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side. More...
 
- Public Attributes inherited from MoFEM::OpBaseImpl< LAST_ASSEMBLE, EleOp >
TimeFun timeScalingFun
 assumes that time variable is set More...
 
FEFun feScalingFun
 assumes that time variable is set More...
 
boost::shared_ptr< RangeentsPtr
 Entities on which element is run. More...
 
- Protected Attributes inherited from MoFEM::OpBaseImpl< LAST_ASSEMBLE, EleOp >
int nbRows
 number of dofs on rows More...
 
int nbCols
 number if dof on column More...
 
int nbIntegrationPts
 number of integration points More...
 
int nbRowBaseFunctions
 number or row base functions More...
 
int rowSide
 row side number More...
 
int colSide
 column side number More...
 
EntityType rowType
 row type More...
 
EntityType colType
 column type More...
 
bool assembleTranspose
 
bool onlyTranspose
 
MatrixDouble locMat
 local entity block matrix More...
 
MatrixDouble locMatTranspose
 local entity block matrix More...
 
VectorDouble locF
 local entity vector More...
 

Detailed Description

template<typename EleOp>
struct MoFEM::OpBaseImpl< USER_ASSEMBLE, EleOp >

Definition at line 25 of file MultifieldPlasticity.hpp.

Member Function Documentation

◆ aSsemble() [1/2]

template<typename EleOp >
MoFEMErrorCode MoFEM::OpBaseImpl< USER_ASSEMBLE, EleOp >::aSsemble ( EntitiesFieldData::EntData data)
inlineprotectedvirtual

Reimplemented from MoFEM::OpBaseImpl< LAST_ASSEMBLE, EleOp >.

Definition at line 119 of file MultifieldPlasticity.hpp.

119 {
121 this->getKSPf(), data, &*this->locF.data().begin(), ADD_VALUES);
122 }
MoFEMErrorCode VecSetValues< EssentialBcStorage >(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Set values to vector in operator.
VectorDouble locF
local entity vector

◆ aSsemble() [2/2]

template<typename EleOp >
MoFEMErrorCode MoFEM::OpBaseImpl< USER_ASSEMBLE, EleOp >::aSsemble ( EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data,
const bool  transpose 
)
inlineprotectedvirtual

Reimplemented from MoFEM::OpBaseImpl< LAST_ASSEMBLE, EleOp >.

Definition at line 31 of file MultifieldPlasticity.hpp.

33 {
35
36 if (transpose) {
37 this->locMatTranspose.resize(this->locMat.size2(), this->locMat.size1(),
38 false);
39 noalias(this->locMatTranspose) = trans(this->locMat);
40 }
41
42 if (auto bmc_ptr = block_mat_container_ptr.lock()) {
43 // if (true) {
44 // if (this->rowFieldName == "SIGMA" || this->colFieldName == "SIGMA") {
45 // // cout << "WE ARE ADDING THE BLOCK" << endl;
46 // // cout << this->rowFieldName << " " << this->colFieldName << endl;
47
48 // }
49 auto &bmc = *bmc_ptr;
50 int *row_ind_ptr = &*row_data.getIndices().begin();
51 int *col_ind_ptr = &*col_data.getIndices().begin();
52 int row_nb_dofs = row_data.getIndices().size();
53 int col_nb_dofs = col_data.getIndices().size();
54 auto &K = this->locMat;
55 auto &transK = this->locMatTranspose;
56
57 auto set_block = [&](auto &row_name, auto &col_name, auto row_side,
58 auto col_side, auto row_type, auto col_type,
59 const auto &m, const auto &row_ind,
60 const auto &col_ind) {
61 auto it = bmc.get<0>().find(boost::make_tuple(
62 row_name, col_name, row_type, col_type, row_side, col_side));
63 if (it != bmc.get<0>().end()) {
64 it->setMat(m);
65 it->setInd(row_ind, col_ind);
66 it->setSetAtElement();
67 } else
68 bmc.insert(BlockMatData(row_name, col_name, row_type, col_type,
69 row_side, col_side, m, row_ind, col_ind));
70 };
71 //FIXME: for contact fieldsplit
72 if (/* true || */ this->rowFieldName != "SIGMA" &&
73 this->colFieldName != "SIGMA") {
74 if (auto e_ptr = row_data.getFieldEntities()[0]) {
75 if (auto stored_data_ptr =
76 e_ptr->getSharedStoragePtr<EssentialBcStorage>()) {
77 if (!this->onlyTranspose)
78 set_block(this->rowFieldName, this->colFieldName, this->rowSide,
79 this->colSide, this->rowType, this->colType, K,
80 stored_data_ptr->entityIndices, col_data.getIndices());
81 if (transpose)
82 set_block(this->colFieldName, this->rowFieldName, this->colSide,
83 this->rowSide, this->colType, this->rowType, transK,
84 col_data.getIndices(), stored_data_ptr->entityIndices);
85 } else {
86 if (!this->onlyTranspose)
87 set_block(this->rowFieldName, this->colFieldName, this->rowSide,
88 this->colSide, this->rowType, this->colType, K,
89 row_data.getIndices(), col_data.getIndices());
90
91 if (transpose)
92 set_block(this->colFieldName, this->rowFieldName, this->colSide,
93 this->rowSide, this->colType, this->rowType, transK,
94 col_data.getIndices(), row_data.getIndices());
95 }
96 } else
97 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
98 "No field entities for assembly");
99 }
100 }
101
102 // Assemble transpose
103 if (transpose) {
105 this->getKSPB(), col_data, row_data,
106 &*this->locMatTranspose.data().begin(), ADD_VALUES);
107 }
108
109 if (!this->onlyTranspose) {
110 // assemble local matrix
112 this->getKSPB(), row_data, col_data, &*this->locMat.data().begin(),
113 ADD_VALUES);
114 }
115
117 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
FTensor::Index< 'm', SPACE_DIM > m
boost::weak_ptr< BlockMatContainer > block_mat_container_ptr
MoFEMErrorCode MatSetValues< EssentialBcStorage >(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Set values to matrix in operator.
MatrixDouble locMatTranspose
local entity block matrix
MatrixDouble locMat
local entity block matrix

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