v0.16.3
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 108 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 741 of file MatOps.cpp.

743 {
745 constexpr int adolc_return_value = 0;
746 CHKERR mat_ops_data_ptr->setActiveContinuousVector(
748 CHKERR mat_ops_data_ptr->setDependentContinuousVector(
750
751 const auto number_of_active_variables =
753 const auto number_of_dependent_variables =
756 number_of_dependent_variables * number_of_active_variables);
757 AdolCEvaluation::jacPtrVec.resize(number_of_dependent_variables);
758 for (unsigned int n = 0; n != number_of_dependent_variables; ++n) {
761 [n * number_of_active_variables]);
762 }
763
764 int r = ::jacobian(tag, dependentVariables.size(), activeVariables.size(),
765 activeVariables.data(), jacPtrVec.data());
766 if (PetscUnlikely(r < adolc_return_value)) {
767 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
768 "ADOL-C function evaluation with error");
769 }
770 CHKERR mat_ops_data_ptr->getDependentDerivativesContinuousVector(
773}
#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:119
static std::vector< double > dependentVariables
Definition MatOps.hpp:118
static std::vector< double > activeVariables
Definition MatOps.hpp:117
static std::vector< double * > jacPtrVec
Definition MatOps.hpp:120

◆ 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 721 of file MatOps.cpp.

723 {
725 CHKERR mat_ops_data_ptr->setActiveContinuousVector(
727 CHKERR mat_ops_data_ptr->setDependentContinuousVector(
729 constexpr int adolc_return_value = 0;
730 int r = ::function(tag, dependentVariables.size(), activeVariables.size(),
731 activeVariables.data(), dependentVariables.data());
732 if (PetscUnlikely(r < adolc_return_value)) {
733 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
734 "ADOL-C function evaluation with error");
735 }
736 CHKERR mat_ops_data_ptr->getDependentContinuousVector(
739}

Member Data Documentation

◆ activeVariables

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

Definition at line 117 of file MatOps.hpp.

◆ dependentVariables

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

Definition at line 118 of file MatOps.hpp.

◆ dependentVariablesDerivatives

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

Definition at line 119 of file MatOps.hpp.

◆ jacPtrVec

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

Definition at line 120 of file MatOps.hpp.


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