v0.9.0
Public Member Functions | Public Attributes | List of all members
CellEngineering::OpVirtualCurlRho Struct Reference

Post-process tractions. More...

#include <users_modules/cell_engineering/src/CellForces.hpp>

Inheritance diagram for CellEngineering::OpVirtualCurlRho:
[legend]
Collaboration diagram for CellEngineering::OpVirtualCurlRho:
[legend]

Public Member Functions

 OpVirtualCurlRho (std::string field_name, CommonData &common_data)
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

CommonDatacommonData
 

Detailed Description

Post-process tractions.

Todo:
Should be done with Prisms, no need to have three kinds of elements, tets for solid, prisms for constrains and triangles to do post-processing. We can do post-pocessing with prisms.
Examples
cell_forces.cpp.

Definition at line 528 of file CellForces.hpp.

Constructor & Destructor Documentation

◆ OpVirtualCurlRho()

CellEngineering::OpVirtualCurlRho::OpVirtualCurlRho ( std::string  field_name,
CommonData common_data 
)

Definition at line 533 of file CellForces.hpp.

535  field_name, UserDataOperator::OPROW),
536  commonData(common_data) {}
ForcesAndSourcesCore::UserDataOperator UserDataOperator

Member Function Documentation

◆ doWork()

MoFEMErrorCode CellEngineering::OpVirtualCurlRho::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)

Real work is done here, i.e. assemble tractions

Definition at line 541 of file CellForces.hpp.

542  {
543  //
544  //
546 
547  if (data.getFieldData().empty())
549 
550  const int nb_gauss_pts = data.getN().size1();
551  const int nb_dofs = data.getFieldData().size();
552 
553  VectorDouble *vec;
554  MatrixDouble *mat;
555  MatrixDouble *grad;
556 
557  if (rowFieldName == "RHO") {
561  }
562 
563  if (type == MBEDGE && side == 0) {
564  mat->resize(nb_gauss_pts, 2, false);
565  mat->clear();
566  grad->resize(nb_gauss_pts, 4, false);
567  grad->clear();
568  vec->resize(0, false);
569  }
570 
571  // calculate forces at integration points
572  auto t_base = data.getFTensor1N<3>();
573  auto t_diff_base_fun = data.getFTensor2DiffN<3, 2>();
574 
575  for (unsigned int gg = 0; gg < nb_gauss_pts; gg++) {
576  auto t_data = data.getFTensor0FieldData();
577  for (int rr = 0; rr != nb_dofs; rr++) {
578  const double base_x = t_base(0);
579  const double base_y = t_base(1);
580  (*mat)(gg, 0) += base_x * t_data;
581  (*mat)(gg, 1) += base_y * t_data;
582  for (int i = 0; i != 2; i++) {
583  for (int j = 0; j != 2; j++) {
584  (*grad)(gg, 2 * i + j) += t_diff_base_fun(i, j) * t_data;
585  }
586  }
587  ++t_data;
588  ++t_base;
589  ++t_diff_base_fun;
590  }
591  }
592 
594  }
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:74
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
VectorDouble forcePotentialAtGaussPoints
Definition: CellForces.hpp:34
MatrixDouble gradForceAtGaussPtrs
Definition: CellForces.hpp:35
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Types.hpp:72

Member Data Documentation

◆ commonData

CommonData& CellEngineering::OpVirtualCurlRho::commonData

Definition at line 531 of file CellForces.hpp.


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