v0.13.0
Public Member Functions | Private Attributes | List of all members
StdRDOperators::OpAssembleNaturalBCRhs Struct Reference

#include <users_modules/softmech/chemo_mech/src/rd_stdOperators.hpp>

Inheritance diagram for StdRDOperators::OpAssembleNaturalBCRhs:
[legend]
Collaboration diagram for StdRDOperators::OpAssembleNaturalBCRhs:
[legend]

Public Member Functions

 OpAssembleNaturalBCRhs (std::string mass_field, Range &natural_bd_ents)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

VectorDouble vecF
 
Range natural_bd_ents
 

Detailed Description

Definition at line 490 of file rd_stdOperators.hpp.

Constructor & Destructor Documentation

◆ OpAssembleNaturalBCRhs()

StdRDOperators::OpAssembleNaturalBCRhs::OpAssembleNaturalBCRhs ( std::string  mass_field,
Range &  natural_bd_ents 
)

Definition at line 492 of file rd_stdOperators.hpp.

493  : OpBoundaryEle(mass_field, OpBoundaryEle::OPROW),
495  cerr << "OpAssembleNaturalBCRhsTau()" << endl;
496  }
BoundaryEle::UserDataOperator OpBoundaryEle

Member Function Documentation

◆ doWork()

MoFEMErrorCode StdRDOperators::OpAssembleNaturalBCRhs::doWork ( int  side,
EntityType  type,
EntData data 
)

Definition at line 498 of file rd_stdOperators.hpp.

498  {
500  const int nb_dofs = data.getIndices().size();
501 
502  if (nb_dofs) {
503  EntityHandle row_side_ent = getFEEntityHandle();
504  bool is_natural =
505  (natural_bd_ents.find(row_side_ent) != natural_bd_ents.end());
506  if (is_natural) {
507  // cerr << "In NaturalBCRhsTau..." << endl;
508  vecF.resize(nb_dofs, false);
509  vecF.clear();
510  const int nb_integration_pts = getGaussPts().size2();
511  auto t_row_base = data.getFTensor0N();
512 
513  auto dir = getDirection();
514  FTensor::Tensor1<double, 3> t_normal(-dir[1], dir[0], dir[2]);
516  auto t_w = getFTensor0IntegrationWeight();
517  const double pi = 3.141592653589793;
518  const double ct = getFEMethod()->ts_t;
519  for (int gg = 0; gg != nb_integration_pts; ++gg) {
520  const double a = t_w;
521  double x = getCoordsAtGaussPts()(gg, 0);
522  double y = getCoordsAtGaussPts()(gg, 1);
523 
524  double mm = -10 * 8 * pi * cos(2 * pi * x) * sin(2 * pi * y) *
525  sin(2 * pi * ct);
526  double nn = -10 * 8 * pi * sin(2 * pi * x) * cos(2 * pi * y) *
527  sin(2 * pi * ct);
528 
529  FTensor::Tensor1<double, 3> t_bd_val(mm, nn, 0.0);
530  double h = t_bd_val(i) * t_normal(i);
531  for (int rr = 0; rr != nb_dofs; ++rr) {
532  vecF[rr] += t_row_base * h * a;
533  ++t_row_base;
534  }
535  ++t_w;
536  }
537  CHKERR VecSetOption(getFEMethod()->ts_F, VEC_IGNORE_NEGATIVE_INDICES,
538  PETSC_TRUE);
539  CHKERR VecSetValues(getFEMethod()->ts_F, data, &*vecF.begin(),
540  ADD_VALUES);
541  }
542  }
544  }
constexpr double a
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
#define CHKERR
Inline error check.
Definition: definitions.h:548
static double const pi
Definition: clipper.cpp:53
FTensor::Index< 'i', 3 > i
double h
convective heat coefficient
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
const VectorInt & getIndices() const
Get global indices of dofs on entity.

Member Data Documentation

◆ natural_bd_ents

Range StdRDOperators::OpAssembleNaturalBCRhs::natural_bd_ents
private

Definition at line 548 of file rd_stdOperators.hpp.

◆ vecF

VectorDouble StdRDOperators::OpAssembleNaturalBCRhs::vecF
private

Definition at line 547 of file rd_stdOperators.hpp.


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