v0.15.5
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< AssembleOp > Struct Template Reference
Inheritance diagram for EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< AssembleOp >:
[legend]
Collaboration diagram for EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< AssembleOp >:
[legend]

Public Types

using OP = AssembleOp
 

Public Member Functions

 OpAssembleTopologicalObjectiveDerivativeImplBase (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< TopologicalData > topo_ptr, boost::shared_ptr< double > J_ptr, SmartPetscObj< Vec > assemble_vec, Tag topo_tag)
 
MoFEMErrorCode assemble (EntData &data) override
 

Protected Attributes

double locJ
 
boost::shared_ptr< doubleJPtr
 
SmartPetscObj< Vec > assembleVec
 
Tag topoTag
 
boost::shared_ptr< TopologicalDatatopoData
 

Detailed Description

template<typename AssembleOp>
struct EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< AssembleOp >

Definition at line 33 of file EshelbianTopologicalDerivativeOperators.cpp.

Member Typedef Documentation

◆ OP

Definition at line 34 of file EshelbianTopologicalDerivativeOperators.cpp.

Constructor & Destructor Documentation

◆ OpAssembleTopologicalObjectiveDerivativeImplBase()

template<typename AssembleOp >
EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< AssembleOp >::OpAssembleTopologicalObjectiveDerivativeImplBase ( const std::string &  field_name,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< TopologicalData topo_ptr,
boost::shared_ptr< double J_ptr,
SmartPetscObj< Vec >  assemble_vec,
Tag  topo_tag 
)
inline

Member Function Documentation

◆ assemble()

template<typename AssembleOp >
MoFEMErrorCode EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< AssembleOp >::assemble ( EntData data)
inlineoverride

Definition at line 45 of file EshelbianTopologicalDerivativeOperators.cpp.

45 {
47 if (assembleVec) {
48 double *vec_ptr = OP::nF.data().data();
49 const int nb_dofs = data.getIndices().size();
50 int *ind_ptr = data.getIndices().data().data();
51 CHKERR VecSetValues(assembleVec, nb_dofs, ind_ptr, vec_ptr, ADD_VALUES);
52 }
53 if (locJ) {
54 *JPtr += locJ;
55 }
56 if (topoTag) {
57 const auto field_ents = data.getFieldEntities();
58 std::vector<EntityHandle> ents(field_ents.size());
59 std::transform(field_ents.begin(), field_ents.end(), ents.begin(),
60 [](const auto *fe) { return fe->getEnt(); });
61 if (field_ents.empty())
63 if (type_from_handle(ents[0]) != MBVERTEX)
65 auto &moab = OP::getMoab();
66 VectorDouble topo_values(OP::nF.size());
67 CHKERR moab.tag_set_data(topoTag, ents.data(), ents.size(),
68 topo_values.data().data());
69 noalias(topo_values) += OP::nF;
70 CHKERR moab.tag_set_data(topoTag, ents.data(), ents.size(),
71 OP::nF.data().data());
72 }
74 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
UBlasVector< double > VectorDouble
Definition Types.hpp:68
auto type_from_handle(const EntityHandle h)
get type from entity handle
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
const VectorFieldEntities & getFieldEntities() const
Get field entities (const version)
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.

Member Data Documentation

◆ assembleVec

template<typename AssembleOp >
SmartPetscObj<Vec> EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< AssembleOp >::assembleVec
protected

Definition at line 79 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ JPtr

Definition at line 78 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ locJ

Definition at line 77 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ topoData

Definition at line 81 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ topoTag

Definition at line 80 of file EshelbianTopologicalDerivativeOperators.cpp.


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