v0.16.0
Loading...
Searching...
No Matches
Static Public Member Functions | Static Private Attributes | List of all members
MatOps::AdolCEvaluation Struct Reference

#include "src/materials/MatOps.hpp"

Collaboration diagram for MatOps::AdolCEvaluation:
[legend]

Static Public Member Functions

static MoFEMErrorCode evaluateVariable (boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag, EntityHandle entity, int gg)
 
static MoFEMErrorCode evaluateDerivatives (boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag, EntityHandle entity, int gg)
 

Static Private Attributes

static std::vector< doubleactiveVariables
 
static std::vector< doubledependentVariables
 
static std::vector< doubledependentVariablesDerivatives
 
static std::vector< double * > jacPtrVec
 

Detailed Description

Definition at line 96 of file MatOps.hpp.

Member Function Documentation

◆ evaluateDerivatives()

MoFEMErrorCode MatOps::AdolCEvaluation::evaluateDerivatives ( boost::shared_ptr< MatOpsData mat_ops_data_ptr,
int  tag,
EntityHandle  entity,
int  gg 
)
static
Examples
mofem/src/materials/MatOps.hpp.

Definition at line 705 of file MatOps.cpp.

707 {
709 constexpr int adolc_return_value = 0;
710 CHKERR mat_ops_data_ptr->setActiveContinuousVector(
712 CHKERR mat_ops_data_ptr->setDependentContinuousVector(
714
715 const auto number_of_active_variables =
717 const auto number_of_dependent_variables =
720 number_of_dependent_variables * number_of_active_variables);
721 AdolCEvaluation::jacPtrVec.resize(number_of_dependent_variables);
722 for (unsigned int n = 0; n != number_of_dependent_variables; ++n) {
725 [n * number_of_active_variables]);
726 }
727
728 int r =
729 ::jacobian(tag, dependentVariables.size(), activeVariables.size(),
730 activeVariables.data(), jacPtrVec.data());
731 if (PetscUnlikely(r < adolc_return_value)) {
732 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
733 "ADOL-C function evaluation with error");
734 }
735 CHKERR mat_ops_data_ptr->getDependentDerivativesContinuousVector(
738}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition definitions.h:34
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
const double n
refractive index of diffusive medium
int r
Definition sdf.py:205
static std::vector< double > dependentVariablesDerivatives
Definition MatOps.hpp:107
static std::vector< double > dependentVariables
Definition MatOps.hpp:106
static std::vector< double > activeVariables
Definition MatOps.hpp:105
static std::vector< double * > jacPtrVec
Definition MatOps.hpp:108

◆ evaluateVariable()

MoFEMErrorCode MatOps::AdolCEvaluation::evaluateVariable ( boost::shared_ptr< MatOpsData mat_ops_data_ptr,
int  tag,
EntityHandle  entity,
int  gg 
)
static
Examples
mofem/src/materials/MatOps.hpp.

Definition at line 685 of file MatOps.cpp.

686 {
688 CHKERR mat_ops_data_ptr->setActiveContinuousVector(
690 CHKERR mat_ops_data_ptr->setDependentContinuousVector(
692 constexpr int adolc_return_value = 0;
693 int r =
694 ::function(tag, dependentVariables.size(), activeVariables.size(),
695 activeVariables.data(), dependentVariables.data());
696 if (PetscUnlikely(r < adolc_return_value)) {
697 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
698 "ADOL-C function evaluation with error");
699 }
700 CHKERR mat_ops_data_ptr->getDependentContinuousVector(
703}

Member Data Documentation

◆ activeVariables

std::vector<double> MatOps::AdolCEvaluation::activeVariables
inlinestaticprivate
Examples
mofem/src/materials/MatOps.hpp.

Definition at line 105 of file MatOps.hpp.

◆ dependentVariables

std::vector<double> MatOps::AdolCEvaluation::dependentVariables
inlinestaticprivate
Examples
mofem/src/materials/MatOps.hpp.

Definition at line 106 of file MatOps.hpp.

◆ dependentVariablesDerivatives

std::vector<double> MatOps::AdolCEvaluation::dependentVariablesDerivatives
inlinestaticprivate
Examples
mofem/src/materials/MatOps.hpp.

Definition at line 107 of file MatOps.hpp.

◆ jacPtrVec

std::vector<double *> MatOps::AdolCEvaluation::jacPtrVec
inlinestaticprivate
Examples
mofem/src/materials/MatOps.hpp.

Definition at line 108 of file MatOps.hpp.


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