v0.12.1
Public Member Functions | Public Attributes | List of all members
CellEngineering::OpCell_g Struct Reference

Calculate and assemble g vector. More...

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

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

Public Member Functions

 OpCell_g (Vec f, const double eps_u, CommonData &common_data)
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

Vec F
 
const double epsU
 
CommonDatacommonData
 
VectorDouble nF
 

Detailed Description

Calculate and assemble g vector.

\[ \mathbf{g} = \int_{S_1} \mathbf{N}^\textrm{T}_\textrm{u} \overline{\mathbf{u}} \textrm{d}S, \]

Definition at line 267 of file CellForces.hpp.

Constructor & Destructor Documentation

◆ OpCell_g()

CellEngineering::OpCell_g::OpCell_g ( Vec  f,
const double  eps_u,
CommonData common_data 
)

Definition at line 274 of file CellForces.hpp.

276  "UPSILON", UserDataOperator::OPROW),
277  F(f), epsU(eps_u), commonData(common_data) {}
ForcesAndSourcesCore::UserDataOperator UserDataOperator

Member Function Documentation

◆ doWork()

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

Definition at line 281 of file CellForces.hpp.

282  {
283 
285 
286  int nb_row = data.getIndices().size();
287  if (nb_row == 0)
289 
290  const VectorDouble &disp_x = *commonData.dispX;
291  const VectorDouble &disp_y = *commonData.dispY;
292 
293  const int nb_gauss_pts = data.getN().size1();
294 
295  nF.resize(nb_row, false);
296  nF.clear();
297  for (int gg = 0; gg != nb_gauss_pts; gg++) {
298  const double val = getGaussPts()(2, gg) * getArea() * pow(epsU, -1);
299  for (int rr = 0; rr != nb_row / 3; rr++) {
300  const double nr = val * data.getN(gg)[rr];
301  nF[3 * rr + 0] += nr * disp_x[gg];
302  nF[3 * rr + 1] += nr * disp_y[gg];
303  }
304  }
305  // assemble local face vector
306  CHKERR VecSetValues(F, nb_row, &data.getIndices()[0], &nF[0], ADD_VALUES);
307 
309  }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:522
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:421
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:491
#define CHKERR
Inline error check.
Definition: definitions.h:610
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Types.hpp:74
constexpr auto VecSetValues
boost::shared_ptr< VectorDouble > dispY
Definition: CellForces.hpp:38
boost::shared_ptr< VectorDouble > dispX
Definition: CellForces.hpp:37

Member Data Documentation

◆ commonData

CommonData& CellEngineering::OpCell_g::commonData

Definition at line 272 of file CellForces.hpp.

◆ epsU

const double CellEngineering::OpCell_g::epsU

Definition at line 271 of file CellForces.hpp.

◆ F

Vec CellEngineering::OpCell_g::F

Definition at line 270 of file CellForces.hpp.

◆ nF

VectorDouble CellEngineering::OpCell_g::nF

Definition at line 279 of file CellForces.hpp.


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