v0.13.1
Public Member Functions | Public Attributes | List of all members
ConvectiveMassElement::OpEshelbyDynamicMaterialMomentumRhs Struct Reference

#include <users_modules/basic_finite_elements/src/ConvectiveMassElement.hpp>

Inheritance diagram for ConvectiveMassElement::OpEshelbyDynamicMaterialMomentumRhs:
[legend]
Collaboration diagram for ConvectiveMassElement::OpEshelbyDynamicMaterialMomentumRhs:
[legend]

Public Member Functions

 OpEshelbyDynamicMaterialMomentumRhs (const std::string field_name, BlockData &data, CommonData &common_data, Range *forcesonlyonentities_ptr)
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
 

Public Attributes

BlockDatadAta
 
CommonDatacommonData
 
Range forcesOnlyOnEntities
 
VectorDouble nf
 

Detailed Description

Definition at line 370 of file ConvectiveMassElement.hpp.

Constructor & Destructor Documentation

◆ OpEshelbyDynamicMaterialMomentumRhs()

ConvectiveMassElement::OpEshelbyDynamicMaterialMomentumRhs::OpEshelbyDynamicMaterialMomentumRhs ( const std::string  field_name,
BlockData data,
CommonData common_data,
Range forcesonlyonentities_ptr 
)

Definition at line 1456 of file ConvectiveMassElement.cpp.

1462 field_name, ForcesAndSourcesCore::UserDataOperator::OPROW),
1463 dAta(data), commonData(common_data) {
1464 if (forcesonlyonentities_ptr != NULL) {
1465 forcesOnlyOnEntities = *forcesonlyonentities_ptr;
1466 }
1467}
ForcesAndSourcesCore::UserDataOperator UserDataOperator
constexpr auto field_name

Member Function Documentation

◆ doWork()

MoFEMErrorCode ConvectiveMassElement::OpEshelbyDynamicMaterialMomentumRhs::doWork ( int  row_side,
EntityType  row_type,
EntitiesFieldData::EntData row_data 
)

Definition at line 1470 of file ConvectiveMassElement.cpp.

1472 {
1474
1475 if (dAta.tEts.find(getNumeredEntFiniteElementPtr()->getEnt()) ==
1476 dAta.tEts.end()) {
1478 }
1479 int nb_dofs = row_data.getIndices().size();
1480 if (nb_dofs == 0)
1482
1483 try {
1484
1485 nf.resize(nb_dofs);
1486 nf.clear();
1487
1488 auto base = row_data.getFTensor0N();
1489 int nb_base_functions = row_data.getN().size2();
1491
1492 for (unsigned int gg = 0; gg < row_data.getN().size1(); gg++) {
1493 FTensor::Tensor1<double *, 3> t_nf(&nf[0], &nf[1], &nf[2], 3);
1495 &commonData.valT[gg][1],
1496 &commonData.valT[gg][2]);
1497 int dd = 0;
1498 for (; dd < nb_dofs / 3; dd++) {
1499 t_nf(i) += base * res(i);
1500 ++base;
1501 ++t_nf;
1502 }
1503 for (; dd != nb_base_functions; dd++) {
1504 ++base;
1505 }
1506 }
1507
1508 if (row_data.getIndices().size() > 3 * row_data.getN().size2()) {
1509 SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
1510 }
1511 if (!forcesOnlyOnEntities.empty()) {
1512 VectorInt indices = row_data.getIndices();
1513 VectorDofs &dofs = row_data.getFieldDofs();
1514 VectorDofs::iterator dit = dofs.begin();
1515 for (int ii = 0; dit != dofs.end(); dit++, ii++) {
1516 if (forcesOnlyOnEntities.find((*dit)->getEnt()) ==
1517 forcesOnlyOnEntities.end()) {
1518 // std::cerr << **dit << std::endl;
1519 indices[ii] = -1;
1520 }
1521 }
1522 // std::cerr << indices << std::endl;
1523 CHKERR VecSetValues(getFEMethod()->ts_F, indices.size(), &indices[0],
1524 &nf[0], ADD_VALUES);
1525 } else {
1526 CHKERR VecSetValues(getFEMethod()->ts_F, row_data.getIndices().size(),
1527 &row_data.getIndices()[0], &nf[0], ADD_VALUES);
1528 }
1529
1530 } catch (const std::exception &ex) {
1531 std::ostringstream ss;
1532 ss << "throw in method: " << ex.what() << std::endl;
1533 SETERRQ(PETSC_COMM_SELF, 1, ss.str().c_str());
1534 }
1535
1537}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define CHKERR
Inline error check.
Definition: definitions.h:535
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
FTensor::Index< 'i', SPACE_DIM > i
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
UBlasVector< int > VectorInt
Definition: Types.hpp:67
ublas::vector< FEDofEntity *, DofsAllocator > VectorDofs
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorDofs & getFieldDofs() const
get dofs data stature FEDofEntity
const VectorInt & getIndices() const
Get global indices of dofs on entity.

Member Data Documentation

◆ commonData

CommonData& ConvectiveMassElement::OpEshelbyDynamicMaterialMomentumRhs::commonData

Definition at line 375 of file ConvectiveMassElement.hpp.

◆ dAta

BlockData& ConvectiveMassElement::OpEshelbyDynamicMaterialMomentumRhs::dAta

Definition at line 374 of file ConvectiveMassElement.hpp.

◆ forcesOnlyOnEntities

Range ConvectiveMassElement::OpEshelbyDynamicMaterialMomentumRhs::forcesOnlyOnEntities

Definition at line 376 of file ConvectiveMassElement.hpp.

◆ nf

VectorDouble ConvectiveMassElement::OpEshelbyDynamicMaterialMomentumRhs::nf

Definition at line 383 of file ConvectiveMassElement.hpp.


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