v0.14.0
Loading...
Searching...
No Matches
DualBase.hpp
Go to the documentation of this file.
1
2
3/**
4 * @brief Dual base
5 *
6 */
7// namespace DualBaseOps {
8
9// struct OpCalculateDualBase : public DomainEleOp {
10// OpCalculateDualBase(const std::string row_name,
11// boost::shared_ptr<OpPlasticTools::CommonData> common_data_ptr)
12// : DomainEleOp(row_name, row_name, DomainEleOp::OPROW),
13// commonDataPtr(common_data_ptr) {
14// sYmm = false;
15// }
16
17// MoFEMErrorCode doWork(int side, EntityType type, EntData &data) {
18// MoFEMFunctionBegin;
19
20// const size_t nb_row_dofs = data.getIndices().size();
21// if (nb_row_dofs) {
22
23// // auto &dual_base = commonDataPtr->dualBaseMat;
24// // dual_base = data.getN()/2;
25
26// const int rank = data.getFieldDofs()[0]->getNbOfCoeffs();
27
28// const size_t nb_integration_pts = data.getN().size1();
29// const size_t nb_row = data.getN().size2();
30// auto t_w = getFTensor0IntegrationWeight();
31
32// auto &dual_base = commonDataPtr->dualBaseMat;
33// dual_base.resize(nb_integration_pts, nb_row, false);
34// dual_base.clear();
35
36// MatrixDouble A(nb_row, nb_row, false);
37// A.clear();
38
39// auto t_row_base = data.getFTensor0N();
40// for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
41// const double alpha = /*getMeasure() **/ t_w;
42// // double w = getGaussPts()(3, gg);
43
44// // A += t_w * outer_prod(data.getN(gg, nb_row),
45// auto B = alpha * outer_prod(data.getN(gg, nb_row),
46// data.getN(gg, nb_row));
47// A += B;
48
49// ++t_w;
50// }
51
52// auto invA = A;
53// CHKERR computeMatrixInverse(invA);
54
55// for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
56// auto shape_function =
57// getVectorAdaptor(&dual_base.data()[gg * nb_row], nb_row);
58// noalias(shape_function) = prod(invA, data.getN(gg, nb_row));
59// }
60// }
61
62// MoFEMFunctionReturn(0);
63// }
64
65// protected:
66// boost::shared_ptr<OpPlasticTools::CommonData> commonDataPtr;
67// };
68
69// struct OpDualSwap : public OpCalculateDualBase {
70// using OpCalculateDualBase::OpCalculateDualBase;
71// MoFEMErrorCode doWork(int side, EntityType type, EntData &data) {
72// MoFEMFunctionBegin;
73
74// const size_t nb_row_dofs = data.getIndices().size();
75// if (nb_row_dofs) {
76// auto &dual_base = commonDataPtr->dualBaseMat;
77// dual_base.swap(data.getN());
78// }
79
80// MoFEMFunctionReturn(0);
81// }
82// };
83
84// }; // namespace DualBaseOps