19using namespace PlasticIncrementalOptimizationInternal;
21namespace PlasticIncrementalOptimizationInternal {
27 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
29 boost::shared_ptr<double> conjugate_work_ptr)
35 "Plastic work operator has a null data pointer");
45 const int nb_integration_pts =
getGaussPts().size2();
46 auto t_p =
dataAtPts->getFTensorApproxP(nb_integration_pts);
47 auto t_f_e =
dataAtPts->getFTensorSmallH(nb_integration_pts);
48 auto t_h_p =
dataAtPts->getFTensorPlasticH(nb_integration_pts);
53 return std::exp(value);
56 double local_work = 0;
57 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
60 t_eigen_vectors(
i,
j) = t_h_p(
i,
j);
64 "Failed to diagonalise the current plastic logarithmic "
66 const int nb_unique = getUniqNb<dim>(t_eigen_values);
68 CHKERR sortEigenVals<dim>(t_eigen_values, t_eigen_vectors);
71 t_eigen_values, t_eigen_vectors, exp_fun, exp_fun, nb_unique);
80 local_work -= t_w * (t_p(
i,
j) * (t_f_e(
i,
k) * t_diff_f_p(
k,
j)));
104 std::map<EntityHandle,
105 std::array<PetscInt, plasticLogarithmicStretchCoordinateSize>>;
117 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
118 boost::shared_ptr<MatrixDouble> adjoint_piola_ptr,
119 boost::shared_ptr<MatrixDouble> adjoint_stretch_ptr,
120 boost::shared_ptr<MatrixDouble> adjoint_rotation_ptr,
121 boost::shared_ptr<MatrixDouble> adjoint_rotation_gradient_ptr,
122 boost::shared_ptr<const PlasticControlDofIndices> control_indices_ptr,
123 Vec
gradient,
const double alpha_omega)
136 "Reduced Helmholtz-gradient operator has a null data pointer");
142 constexpr int coordinate_size =
144 constexpr int stretch_size = dim * (dim + 1) / 2;
145 const int nb_integration_pts =
getGaussPts().size2();
149 "Plastic cell %llu has no control-DOF layout",
153 const auto check_matrix =
154 [nb_integration_pts](
const boost::shared_ptr<MatrixDouble> &matrix_ptr,
155 const int columns,
const char *name) {
157 if (matrix_ptr->size1() != nb_integration_pts ||
158 matrix_ptr->size2() != columns)
160 "Inconsistent %s data in reduced Helmholtz gradient",
168 "rotation-adjoint gradient");
172 auto t_adjoint_piola =
175 auto t_adjoint_stretch =
178 auto t_adjoint_rotation =
181 auto t_adjoint_rotation_gradient =
184 auto t_reference_p =
dataAtPts->getFTensorApproxP(nb_integration_pts);
185 auto t_elastic_f =
dataAtPts->getFTensorSmallH(nb_integration_pts);
186 auto t_plastic_h =
dataAtPts->getFTensorPlasticH(nb_integration_pts);
187 auto t_plastic_f =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
188 auto t_inv_plastic_f =
189 dataAtPts->getFTensorInvPlasticF(nb_integration_pts);
190 auto t_adjoint_stress_d_p =
191 dataAtPts->getFTensorAdjointPdUdP(nb_integration_pts);
193 dataAtPts->getFTensorLeviKirchhoffP(nb_integration_pts);
194 auto t_rotation_gradient =
195 dataAtPts->getFTensorRotAxisGrad(nb_integration_pts);
198 std::array<PetscScalar, coordinate_size> local_gradient{};
203 return std::exp(value);
206 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
209 t_eigen_vectors(
i,
j) = t_plastic_h(
i,
j);
213 "Failed to diagonalise plastic logarithmic stretch while "
214 "assembling its reduced gradient");
215 const int nb_unique = getUniqNb<dim>(t_eigen_values);
217 CHKERR sortEigenVals<dim>(t_eigen_values, t_eigen_vectors);
219 t_eigen_values, t_eigen_vectors, exp_fun, exp_fun, nb_unique);
224 t_adjoint_rotation_gradient_pull(
k,
j) =
225 t_adjoint_rotation_gradient(
k,
i) * t_inv_plastic_f(
i,
j);
226 t_rotation_gradient_pull(
k,
j) =
227 t_rotation_gradient(
k,
i) * t_inv_plastic_f(
i,
j);
229 for (
int coordinate = 0; coordinate != coordinate_size; ++coordinate) {
231 t_coordinate_direction(C) = 0.;
232 t_coordinate_direction(coordinate) = 1.;
233 const auto t_direction =
235 t_coordinate_direction);
237 t_d_plastic_f(
i,
j) =
238 t_diff_exp(
i,
j,
k,
l) * t_direction(
k,
l);
240 t_d_inv_plastic_f(
i,
j) =
241 -t_inv_plastic_f(
i,
k) * t_d_plastic_f(
k,
l) *
242 t_inv_plastic_f(
l,
j);
247 double residual_derivative_contraction =
248 -t_adjoint_piola(
i,
k) * t_elastic_f(
i,
j) *
252 t_d_intermediate_p(
i,
j) =
253 t_reference_p(
i,
k) * t_d_plastic_f(
j,
k) / det_plastic_f;
255 t_d_adjoint_stress(S) =
256 t_adjoint_stress_d_p(
i,
j, S) * t_d_intermediate_p(
i,
j);
259 residual_derivative_contraction -=
261 (t_adjoint_stretch(S) * t_d_adjoint_stress(S));
264 t_d_levi(
k) = t_levi_d_p(
k,
i,
j) * t_d_intermediate_p(
i,
j);
265 residual_derivative_contraction -=
266 det_plastic_f * t_adjoint_rotation(
k) * t_d_levi(
k);
270 t_d_adjoint_rotation_gradient_pull;
272 t_d_adjoint_rotation_gradient_pull(
k,
j) =
273 t_adjoint_rotation_gradient(
k,
i) *
274 t_d_inv_plastic_f(
i,
j);
275 t_d_rotation_gradient_pull(
k,
j) =
276 t_rotation_gradient(
k,
i) * t_d_inv_plastic_f(
i,
j);
277 residual_derivative_contraction +=
279 (t_d_adjoint_rotation_gradient_pull(
k,
j) *
280 t_rotation_gradient_pull(
k,
j) +
281 t_adjoint_rotation_gradient_pull(
k,
j) *
282 t_d_rotation_gradient_pull(
k,
j));
288 local_gradient[coordinate] -=
289 getMeasure() * t_w * residual_derivative_contraction;
294 ++t_adjoint_rotation;
295 ++t_adjoint_rotation_gradient;
301 ++t_adjoint_stress_d_p;
303 ++t_rotation_gradient;
308 local_gradient.data(), ADD_VALUES);
333 boost::shared_ptr<MatrixDouble> coefficient_force_ptr)
339 "Plastic-force operator has a null integration-point data or "
340 "coefficient-force pointer");
347 const int nb_integration_pts =
getGaussPts().size2();
353 auto t_force = get_force();
354 auto t_p =
dataAtPts->getFTensorApproxP(nb_integration_pts);
355 auto t_f_e =
dataAtPts->getFTensorSmallH(nb_integration_pts);
356 auto t_h_p =
dataAtPts->getFTensorPlasticH(nb_integration_pts);
361 return std::exp(value);
364 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
367 t_eigen_vectors(
i,
j) = t_h_p(
i,
j);
371 "Failed to diagonalise the current plastic logarithmic "
373 const int nb_unique = getUniqNb<dim>(t_eigen_values);
375 CHKERR sortEigenVals<dim>(t_eigen_values, t_eigen_vectors);
377 t_eigen_values, t_eigen_vectors, exp_fun, exp_fun, nb_unique);
381 t_elastic_pull_back(
k,
j) = t_f_e(
i,
k) * t_p(
i,
j);
382 t_tensor_force(
m,
n) =
383 -t_diff_exp(
k,
j,
m,
n) * t_elastic_pull_back(
k,
j);
384 const auto t_coordinate_force =
386 t_force(
L) = t_coordinate_force(
L);
404 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
406 boost::shared_ptr<MatrixDouble> tensor_values,
412 "Plastic logarithmic-stretch output is null");
413 if (data_dm && !data_vector)
415 "Cross-DM plastic logarithmic-stretch evaluation requires a "
419 pipeline.push_back(
new OpCalculateTensor2SymmetricDeviatorFieldValues<SPACE_DIM>(
421 tensor_values, data_vector, zero_type));
423 pipeline.push_back(
new OpCalculateTensor2SymmetricDeviatorFieldValues<SPACE_DIM>(
424 field_name, tensor_values, data_vector, zero_type));
435 "Material equations or integration-point data are not set");
437 auto local_helmholtz_free_energy = boost::make_shared<double>(0);
438 auto fe = boost::make_shared<MechanicalValueEle>(ep.
mField);
441 CHKERR TSGetTime(ts, &fe->ts_t);
442 CHKERR TSGetTimeStep(ts, &fe->ts_dt);
445 auto *helmholtz_free_energy_op =
447 ep.
dataAtPts, local_helmholtz_free_energy);
448 if (!helmholtz_free_energy_op)
450 "Selected material does not provide a Helmholtz free energy");
451 fe->getOpPtrVector().push_back(helmholtz_free_energy_op);
453 TetPolynomialBase::switchCacheBaseOn<HDIV>({fe.get()});
456 TetPolynomialBase::switchCacheBaseOff<HDIV>({fe.get()});
459 double global_helmholtz_free_energy = 0;
460 const int mpi_error =
461 MPI_Allreduce(local_helmholtz_free_energy.get(),
462 &global_helmholtz_free_energy, 1, MPI_DOUBLE, MPI_SUM,
464 if (mpi_error != MPI_SUCCESS)
466 "MPI reduction of the equilibrated mechanical value failed");
472 value = global_helmholtz_free_energy;
480 double &conjugate_work) {
485 "Plastic conjugate work requires a non-empty plastic volume");
487 auto local_work = boost::make_shared<double>(0);
488 auto fe = boost::make_shared<MechanicalValueEle>(ep.
mField);
492 fe->exeTestHook = [&ep](
FEMethod *fe_method_ptr) {
493 return ep.
plasticVolumes->find(fe_method_ptr->getFEEntityHandle()) !=
497 TetPolynomialBase::switchCacheBaseOn<HDIV>({fe.get()});
500 TetPolynomialBase::switchCacheBaseOff<HDIV>({fe.get()});
503 const int mpi_error =
504 MPI_Allreduce(local_work.get(), &conjugate_work, 1, MPI_DOUBLE, MPI_SUM,
506 if (mpi_error != MPI_SUCCESS)
508 "MPI reduction of the plastic conjugate work failed");
513namespace PlasticIncrementalOptimizationInternal {
521 "Plastic-force vector is null");
522 CHKERR VecZeroEntries(force);
526 auto force_at_points = boost::make_shared<MatrixDouble>();
527 auto fe = boost::make_shared<MechanicalValueEle>(ep.
mField);
530 fe->getOpPtrVector().push_back(
532 fe->getOpPtrVector().push_back(
534 fe->exeTestHook = [&ep](
FEMethod *method) {
539 TetPolynomialBase::switchCacheBaseOn<HDIV>({fe.get()});
542 TetPolynomialBase::switchCacheBaseOff<HDIV>({fe.get()});
544 CHKERR VecAssemblyBegin(force);
545 CHKERR VecAssemblyEnd(force);
553 boost::shared_ptr<PlasticControlDofIndices> &control_indices_ptr) {
555 control_indices_ptr = boost::make_shared<PlasticControlDofIndices>();
556 const Problem *problem_ptr =
nullptr;
560 "Incremental-optimization problem has no numbered row DOFs");
562 const auto field_bit =
570 for (; dof_it != dof_end; ++dof_it) {
571 const auto &dof = *dof_it;
572 if (dof->getDofOrder() != 0 ||
575 auto [indices_it, inserted] =
576 control_indices_ptr->try_emplace(dof->getEnt());
578 indices_it->second.fill(-1);
579 auto &index = indices_it->second[dof->getDofCoeffIdx()];
582 "Duplicate plastic control coefficient %d on entity %llu",
583 dof->getDofCoeffIdx(),
584 static_cast<unsigned long long>(dof->getEnt()));
585 index = dof->getPetscGlobalDofIdx();
588 for (
const auto &[entity, indices] : *control_indices_ptr)
589 for (int coordinate = 0;
592 if (indices[coordinate] < 0)
594 "Plastic control entity %llu has no global index for "
596 static_cast<unsigned long long>(entity), coordinate);
601 Vec state_gradient) {
603 CHKERR VecZeroEntries(state_gradient);
604 auto fe = boost::make_shared<MechanicalValueEle>(ep.
mField);
605 fe->ksp_f = state_gradient;
610 TetPolynomialBase::switchCacheBaseOn<HDIV>({fe.get()});
613 TetPolynomialBase::switchCacheBaseOff<HDIV>({fe.get()});
615 CHKERR VecAssemblyBegin(state_gradient);
616 CHKERR VecAssemblyEnd(state_gradient);
617 CHKERR VecGhostUpdateBegin(state_gradient, ADD_VALUES, SCATTER_REVERSE);
618 CHKERR VecGhostUpdateEnd(state_gradient, ADD_VALUES, SCATTER_REVERSE);
619 CHKERR VecGhostUpdateBegin(state_gradient, INSERT_VALUES, SCATTER_FORWARD);
620 CHKERR VecGhostUpdateEnd(state_gradient, INSERT_VALUES, SCATTER_FORWARD);
625 Vec state_gradient, Vec adjoint) {
631 "State TS has no solution for the Helmholtz adjoint");
633 CHKERR VecZeroEntries(zero_rate);
634 PetscReal pseudo_time = 0;
635 CHKERR TSGetTime(ts, &pseudo_time);
637 Mat jacobian =
nullptr;
638 Mat preconditioner =
nullptr;
639 CHKERR TSGetIJacobian(ts, &jacobian, &preconditioner, PETSC_NULLPTR,
641 if (!jacobian || !preconditioner)
643 "State TS has no IJacobian matrices for the static adjoint");
646 CHKERR TSComputeIJacobian(ts, pseudo_time,
state, zero_rate, 0., jacobian,
647 preconditioner, PETSC_FALSE);
651 CHKERR TSGetSNES(ts, &snes);
652 CHKERR SNESGetKSP(snes, &ksp);
653 CHKERR KSPSetOperators(ksp, jacobian, preconditioner);
654 CHKERR KSPSetInitialGuessNonzero(ksp, PETSC_FALSE);
655 CHKERR VecZeroEntries(adjoint);
656 CHKERR KSPSolveTranspose(ksp, state_gradient, adjoint);
657 KSPConvergedReason reason;
658 CHKERR KSPGetConvergedReason(ksp, &reason);
661 "Static Helmholtz adjoint diverged with KSP reason %d",
662 static_cast<int>(reason));
663 CHKERR VecGhostUpdateBegin(adjoint, INSERT_VALUES, SCATTER_FORWARD);
664 CHKERR VecGhostUpdateEnd(adjoint, INSERT_VALUES, SCATTER_FORWARD);
668 CHKERR MatMultTranspose(jacobian, adjoint, adjoint_residual);
669 CHKERR VecAXPY(adjoint_residual, -1., state_gradient);
670 PetscReal state_gradient_norm = 0;
671 PetscReal residual_norm = 0;
672 CHKERR VecNorm(state_gradient, NORM_2, &state_gradient_norm);
673 CHKERR VecNorm(adjoint_residual, NORM_2, &residual_norm);
675 <<
"Static Helmholtz adjoint residual " << residual_norm
676 <<
", material state-gradient norm " << state_gradient_norm;
685 CHKERR VecZeroEntries(gradient);
686 auto control_indices = boost::shared_ptr<PlasticControlDofIndices>();
687 CHKERR createPlasticControlDofIndices(ep, control_indices);
688 auto adjoint_piola = boost::make_shared<MatrixDouble>();
689 auto adjoint_stretch = ep.
dataAtPts->getVarLogStreachPts();
690 auto adjoint_rotation = boost::make_shared<MatrixDouble>();
691 auto adjoint_rotation_gradient = boost::make_shared<MatrixDouble>();
694 auto fe = boost::make_shared<MechanicalValueEle>(ep.
mField);
700 fe->getOpPtrVector().push_back(
702 ep.
piolaStress, adjoint_piola,
nullptr, adjoint_vector));
703 fe->getOpPtrVector().push_back(
705 ep.
bubbleField, adjoint_piola,
nullptr, adjoint_vector, MBMAXTYPE));
707 ep, fe->getOpPtrVector(), ep.
dataAtPts, adjoint_vector);
709 ep.
rotAxis, adjoint_rotation, adjoint_vector, MBTET));
710 fe->getOpPtrVector().push_back(
712 ep.
rotAxis, adjoint_rotation_gradient, adjoint_vector, MBTET));
713 fe->getOpPtrVector().push_back(
new OpAssembleReducedHelmholtzGradient(
714 ep.
dataAtPts, adjoint_piola, adjoint_stretch, adjoint_rotation,
715 adjoint_rotation_gradient, control_indices, gradient, ep.
alphaOmega));
716 fe->exeTestHook = [&ep](
FEMethod *method) {
721 TetPolynomialBase::switchCacheBaseOn<HDIV>({fe.get()});
724 TetPolynomialBase::switchCacheBaseOff<HDIV>({fe.get()});
726 CHKERR VecAssemblyBegin(gradient);
727 CHKERR VecAssemblyEnd(gradient);
728 CHKERR VecGhostUpdateBegin(gradient, INSERT_VALUES, SCATTER_FORWARD);
729 CHKERR VecGhostUpdateEnd(gradient, INSERT_VALUES, SCATTER_FORWARD);
738 if (!ts || !gradient)
740 "Reduced Helmholtz gradient requires a TS and output vector");
743 CHKERR assembleHelmholtzStateGradient(ep, state_gradient);
744 CHKERR solveStaticHelmholtzAdjoint(ep, ts, state_gradient, adjoint);
745 CHKERR assemblePlasticAdjointContribution(ep, adjoint, gradient);
Eshelbian plasticity interface.
Lie algebra implementation.
Shared implementation details for plastic incremental optimization.
Plasticity implementation of incremental optimization.
#define FTENSOR_INDEXES(DIM,...)
#define FTENSOR_INDEX(DIM, I)
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#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 ...
@ MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
auto createDMVector(DM dm, RowColData rc=RowColData::COL)
Get smart vector from DM.
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
const double n
refractive index of diffusive medium
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
boost::function< T(const T)> Fun
const FTensor::Tensor2< T, Dim, Dim > Vec
auto getDiffMat(A &&t_val, B &&t_vec, Fun< double > f, Fun< double > d_f, const int nb)
Get the Diff Mat object.
FormsIntegrators< VolUserDataOperator >::Assembly< A >::LinearForm< GAUSS >::OpBaseTimesVector< 1, plasticLogarithmicStretchCoordinateSize, plasticLogarithmicStretchCoordinateSize > OpAssemblePlasticForce
MoFEMErrorCode assemblePlasticForce(EshelbianCore &ep, Vec force)
std::map< EntityHandle, std::array< PetscInt, plasticLogarithmicStretchCoordinateSize > > PlasticControlDofIndices
FTensor::Tensor1< double, plasticLogarithmicStretchCoordinateSize > plasticLogarithmicStretchCoordinatesFromTensor(const FTensor::Tensor2_symmetric< T, SPACE_DIM > &t_values)
MoFEMErrorCode assembleReducedHelmholtzGradient(EshelbianCore &ep, TS ts, Vec gradient)
FTensor::Tensor2_symmetric< double, SPACE_DIM > plasticLogarithmicStretchTensorFromCoordinates(const FTensor::Tensor1< T, plasticLogarithmicStretchCoordinateSize > &t_coordinates)
constexpr int plasticLogarithmicStretchCoordinateSize
MoFEMErrorCode validateEquilibratedMechanicalValueScope(EshelbianCore &ep)
MoFEMErrorCode evaluateEquilibratedMechanicalValue(EshelbianCore &ep, TS ts, double &value)
MoFEMErrorCode evaluatePlasticConjugateWork(EshelbianCore &ep, const FTensor::Tensor2_symmetric< double, SPACE_DIM > &t_direction, double &conjugate_work)
MoFEMErrorCode addCalculatePlasticLogarithmicStretchFieldValues(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, const std::string &field_name, boost::shared_ptr< MatrixDouble > tensor_values, const EntityType zero_type, SmartPetscObj< DM > data_dm, SmartPetscObj< Vec > data_vector)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
decltype(GetFTensor1FromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor1FromMatType
MoFEMErrorCode computeEigenValuesSymmetric(const MatrixDouble &mat, VectorDouble &eig, MatrixDouble &eigen_vec)
compute eigenvalues of a symmetric matrix using lapack dsyev
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
decltype(GetFTensor2FromMatImpl< Tensor_Dim0, Tensor_Dim1, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor2FromMatType
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
constexpr auto field_name
FTensor::Index< 'm', 3 > m
MoFEM::Interface & mField
boost::shared_ptr< Range > plasticVolumes
const std::string elementVolumeName
const std::string piolaStress
const std::string bubbleField
const std::string plasticFlowField
boost::shared_ptr< PhysicalEquations > physicalEquations
const std::string rotAxis
MoFEMErrorCode setBaseVolumeElementOps(const int tag, const bool do_rhs, const bool do_lhs, const bool calc_rates, boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe, const bool add_bubble=true)
static PetscBool plasticVolume
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
SmartPetscObj< DM > dmElastic
Elastic problem.
SmartPetscObj< DM > dmIncrementalOptimization
Incremental-optimization control problem.
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
boost::shared_ptr< MatrixDouble > adjointRotationPtr
boost::shared_ptr< MatrixDouble > adjointRotationGradientPtr
boost::shared_ptr< MatrixDouble > adjointPiolaPtr
OpAssembleReducedHelmholtzGradient(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< MatrixDouble > adjoint_piola_ptr, boost::shared_ptr< MatrixDouble > adjoint_stretch_ptr, boost::shared_ptr< MatrixDouble > adjoint_rotation_ptr, boost::shared_ptr< MatrixDouble > adjoint_rotation_gradient_ptr, boost::shared_ptr< const PlasticControlDofIndices > control_indices_ptr, Vec gradient, const double alpha_omega)
boost::shared_ptr< MatrixDouble > adjointStretchPtr
MoFEMErrorCode doWork(int, EntityType, EntData &) override
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< const PlasticControlDofIndices > controlIndicesPtr
boost::shared_ptr< MatrixDouble > coefficientForcePtr
OpCalculatePlasticForce(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< MatrixDouble > coefficient_force_ptr)
MoFEMErrorCode doWork(int, EntityType, EntData &) override
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
boost::shared_ptr< double > conjugateWorkPtr
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
OpIntegratePlasticConjugateWork(boost::shared_ptr< DataAtIntegrationPts > data_ptr, FTensor::Tensor2_symmetric< double, SPACE_DIM > t_direction_in, boost::shared_ptr< double > conjugate_work_ptr)
FTensor::Tensor2_symmetric< double, SPACE_DIM > t_direction
MoFEMErrorCode doWork(int side, EntityType type, EntData &data) override
Operator for linear form, usually to calculate values on right hand side.
virtual FieldBitNumber get_field_bit_number(const std::string name) const =0
get field bit number
virtual MPI_Comm & get_comm() const =0
Data on single entity (This is passed as argument to DataOperator::doWork)
Structure for user loop methods on finite elements.
static UId getHiBitNumberUId(const FieldBitNumber bit_number)
static UId getLoBitNumberUId(const FieldBitNumber bit_number)
EntityHandle getFEEntityHandle() const
Return finite element entity handle.
auto getFTensor0IntegrationWeight()
Get integration weights.
double getMeasure() const
get measure of element
@ OPROW
operator doWork function is executed on FE rows
@ OPSPACE
operator do Work is execute on space data
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
Calculate tenor field using tensor base, i.e. Hdiv/Hcurl.
Calculate tenor field using vectorial base, i.e. Hdiv/Hcurl.
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.
Specialization for MatrixDouble vector field values calculation.
@ CTX_SET_TIME
Time value is set.
keeps basic data about problem
auto & getNumeredRowDofsPtr() const
get access to numeredRowDofsPtr storing DOFs on rows
intrusive_ptr for managing petsc objects
@ CTX_TSSETIJACOBIAN
Setting up implicit Jacobian.
Volume finite element base.