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

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

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

Public Types

typedef boost::function< double(const double, const double, const double)> FVal
 
typedef boost::function< FTensor::Tensor1< double, 3 > const double, const double, const double)> FGrad
 

Public Member Functions

 OpAssembleSlowRhs (std::string field, boost::shared_ptr< PreviousData > &data, FVal exact_value, FVal exact_dot, FVal exact_lap)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< PreviousDatacommonData
 
VectorDouble vecF
 
FVal exactValue
 
FVal exactDot
 
FVal exactLap
 
FTensor::Number< 0 > NX
 
FTensor::Number< 1 > NY
 
FTensor::Number< 2 > NZ
 

Detailed Description

Definition at line 217 of file rd_stdOperators.hpp.

Member Typedef Documentation

◆ FGrad

typedef boost::function<FTensor::Tensor1<double, 3> const double, const double, const double)> StdRDOperators::OpAssembleSlowRhs::FGrad

Definition at line 222 of file rd_stdOperators.hpp.

◆ FVal

typedef boost::function<double(const double, const double, const double)> StdRDOperators::OpAssembleSlowRhs::FVal

Definition at line 219 of file rd_stdOperators.hpp.

Constructor & Destructor Documentation

◆ OpAssembleSlowRhs()

StdRDOperators::OpAssembleSlowRhs::OpAssembleSlowRhs ( std::string  field,
boost::shared_ptr< PreviousData > &  data,
FVal  exact_value,
FVal  exact_dot,
FVal  exact_lap 
)

Definition at line 223 of file rd_stdOperators.hpp.

228  : OpEle(field, OpEle::OPROW), commonData(data), exactValue(exact_value),
229  exactDot(exact_dot), exactLap(exact_lap) {}
FaceElementForcesAndSourcesCore::UserDataOperator OpEle
boost::shared_ptr< PreviousData > commonData

Member Function Documentation

◆ doWork()

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

Definition at line 231 of file rd_stdOperators.hpp.

231  {
233 
234  const int nb_dofs = data.getIndices().size();
235  if (nb_dofs) {
236  vecF.resize(nb_dofs, false);
237  vecF.clear();
238  const int nb_integration_pts = getGaussPts().size2();
239 
240  auto t_slow_value = getFTensor0FromVec(commonData->slow_values);
241 
242  auto t_base = data.getFTensor0N();
243  auto t_w = getFTensor0IntegrationWeight();
244  const double vol = getMeasure();
245 
246  // cout << "measure : " << getMeasure() << endl;
247  const double ct = getFEMethod()->ts_t;
248  auto t_coords = getFTensor1CoordsAtGaussPts();
249  for (int gg = 0; gg != nb_integration_pts; ++gg) {
250  const double a = vol * t_w;
251 
252  double u_dot = exactDot(t_coords(NX), t_coords(NY), ct);
253  double u_lap = exactLap(t_coords(NX), t_coords(NY), ct);
254 
255  // double f = u_dot - u_lap;
256  const double f = t_slow_value;
257 
258  for (int rr = 0; rr != nb_dofs; ++rr) {
259  const double b = a * f * t_base;
260  vecF[rr] += b;
261  ++t_base;
262  }
263  ++t_slow_value;
264  ++t_w;
265  ++t_coords;
266  }
267  CHKERR VecSetOption(getFEMethod()->ts_F, VEC_IGNORE_NEGATIVE_INDICES,
268  PETSC_TRUE);
269  CHKERR VecSetValues(getFEMethod()->ts_F, data, &*vecF.begin(),
270  ADD_VALUES);
271  }
273  }
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 auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:149
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

◆ commonData

boost::shared_ptr<PreviousData> StdRDOperators::OpAssembleSlowRhs::commonData
private

Definition at line 276 of file rd_stdOperators.hpp.

◆ exactDot

FVal StdRDOperators::OpAssembleSlowRhs::exactDot
private

Definition at line 280 of file rd_stdOperators.hpp.

◆ exactLap

FVal StdRDOperators::OpAssembleSlowRhs::exactLap
private

Definition at line 281 of file rd_stdOperators.hpp.

◆ exactValue

FVal StdRDOperators::OpAssembleSlowRhs::exactValue
private

Definition at line 279 of file rd_stdOperators.hpp.

◆ NX

FTensor::Number<0> StdRDOperators::OpAssembleSlowRhs::NX
private

Definition at line 283 of file rd_stdOperators.hpp.

◆ NY

FTensor::Number<1> StdRDOperators::OpAssembleSlowRhs::NY
private

Definition at line 284 of file rd_stdOperators.hpp.

◆ NZ

FTensor::Number<2> StdRDOperators::OpAssembleSlowRhs::NZ
private

Definition at line 285 of file rd_stdOperators.hpp.

◆ vecF

VectorDouble StdRDOperators::OpAssembleSlowRhs::vecF
private

Definition at line 277 of file rd_stdOperators.hpp.


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