v0.14.0
Loading...
Searching...
No Matches
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 1452 of file ConvectiveMassElement.cpp.

1457 : VolumeElementForcesAndSourcesCore::UserDataOperator(
1458 field_name, ForcesAndSourcesCore::UserDataOperator::OPROW),
1459 dAta(data), commonData(common_data) {
1460 if (forcesonlyonentities_ptr != NULL) {
1461 forcesOnlyOnEntities = *forcesonlyonentities_ptr;
1462 }
1463}
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 1466 of file ConvectiveMassElement.cpp.

1467 {
1469
1470 if (dAta.tEts.find(getNumeredEntFiniteElementPtr()->getEnt()) ==
1471 dAta.tEts.end()) {
1473 }
1474 int nb_dofs = row_data.getIndices().size();
1475 if (nb_dofs == 0)
1477
1478 try {
1479
1480 nf.resize(nb_dofs);
1481 nf.clear();
1482
1483 auto base = row_data.getFTensor0N();
1484 int nb_base_functions = row_data.getN().size2();
1486
1487 for (unsigned int gg = 0; gg < row_data.getN().size1(); gg++) {
1488 FTensor::Tensor1<double *, 3> t_nf(&nf[0], &nf[1], &nf[2], 3);
1490 &commonData.valT[gg][1],
1491 &commonData.valT[gg][2]);
1492 int dd = 0;
1493 for (; dd < nb_dofs / 3; dd++) {
1494 t_nf(i) += base * res(i);
1495 ++base;
1496 ++t_nf;
1497 }
1498 for (; dd != nb_base_functions; dd++) {
1499 ++base;
1500 }
1501 }
1502
1503 if (row_data.getIndices().size() > 3 * row_data.getN().size2()) {
1504 SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
1505 }
1506 if (!forcesOnlyOnEntities.empty()) {
1507 VectorInt indices = row_data.getIndices();
1508 VectorDofs &dofs = row_data.getFieldDofs();
1509 VectorDofs::iterator dit = dofs.begin();
1510 for (int ii = 0; dit != dofs.end(); dit++, ii++) {
1511 if (forcesOnlyOnEntities.find((*dit)->getEnt()) ==
1512 forcesOnlyOnEntities.end()) {
1513 // std::cerr << **dit << std::endl;
1514 indices[ii] = -1;
1515 }
1516 }
1517 // std::cerr << indices << std::endl;
1518 CHKERR VecSetValues(getFEMethod()->ts_F, indices.size(), &indices[0],
1519 &nf[0], ADD_VALUES);
1520 } else {
1521 CHKERR VecSetValues(getFEMethod()->ts_F, row_data.getIndices().size(),
1522 &row_data.getIndices()[0], &nf[0], ADD_VALUES);
1523 }
1524
1525 } catch (const std::exception &ex) {
1526 std::ostringstream ss;
1527 ss << "throw in method: " << ex.what() << std::endl;
1528 SETERRQ(PETSC_COMM_SELF, 1, ss.str().c_str());
1529 }
1530
1532}
#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
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
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: