v0.16.3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ADOLCPlasticity::HeterogeneousParaboloidalPlasticity Struct Reference

#include "users_modules/adolc-plasticity/src/ADOLCPlasticityMaterialModels.hpp"

Inheritance diagram for ADOLCPlasticity::HeterogeneousParaboloidalPlasticity:
[legend]
Collaboration diagram for ADOLCPlasticity::HeterogeneousParaboloidalPlasticity:
[legend]

Public Member Functions

MoFEMErrorCode addMatBlockOps (MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string block_name, Sev sev) override
 Get model parameters from blocks.
 
 ParaboloidalPlasticity ()
 
- Public Member Functions inherited from ADOLCPlasticity::ParaboloidalPlasticity
 ParaboloidalPlasticity ()
 
MoFEMErrorCode getDefaultMaterialParameters ()
 
MoFEMErrorCode addMatBlockOps (MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string block_name, Sev sev)
 Get model parameters from blocks.
 
MoFEMErrorCode setParams (short tag, bool &recalculate_elastic_tangent)
 Set parameters for ADOL-C of constitutive relations.
 
MoFEMErrorCode freeHemholtzEnergy ()
 [Paraboloidal free energy]
 
MoFEMErrorCode codedHessianW (vector< double * > hessian)
 [Paraboloidal free energy]
 
MoFEMErrorCode evalF ()
 [Paraboloidal yield function]
 
MoFEMErrorCode yieldFunction ()
 Set yield function.
 
MoFEMErrorCode flowPotential ()
 [Paraboloidal yield function]
 
- Public Member Functions inherited from ADOLCPlasticity::ClosestPointProjection
VectorAdaptor getPlasticStrain ()
 
VectorAdaptor getTotalStrain ()
 
VectorAdaptor getInternalVariables ()
 
VectorAdaptor getActiveVariablesYH ()
 
VectorAdaptor getStress ()
 
VectorAdaptor getInternalFluxes ()
 
 ClosestPointProjection ()
 
MoFEMErrorCode recordW ()
 Record strain energy.
 
MoFEMErrorCode recordY ()
 Record yield function.
 
MoFEMErrorCode recordH ()
 Record flow potential.
 
MoFEMErrorCode playW ()
 
MoFEMErrorCode playW_NoHessian ()
 
MoFEMErrorCode playY ()
 
MoFEMErrorCode playY_NoGradient ()
 
MoFEMErrorCode playH ()
 
MoFEMErrorCode playH_NoHessian ()
 
MoFEMErrorCode createMatAVecR ()
 
MoFEMErrorCode evaluatePotentials ()
 
MoFEMErrorCode playPotentials ()
 
MoFEMErrorCode playPotentials_NoHessian ()
 
MoFEMErrorCode calculateR (Vec R)
 
MoFEMErrorCode calculateA ()
 
MoFEMErrorCode snesCreate ()
 Create nested snes.
 
MoFEMErrorCode solveClosestProjection ()
 Solve nonlinear system of equations to find stress, internal fluxes, and Lagrange plastic multiplier.
 
MoFEMErrorCode consistentTangent ()
 Calculate consistent tangent matrix.
 
MoFEMErrorCode recordTapes ()
 Record tapes.
 

Additional Inherited Members

- Public Types inherited from ADOLCPlasticity::ParaboloidalPlasticity
enum  ModelParams {
  LAMBDA , MU , NUP , SIGMA_YT ,
  SIGMA_YC , HT , HC , NT ,
  NC , LAST_PARAM
}
 
using ParamsArray = std::array< double, LAST_PARAM >
 
- Public Types inherited from ADOLCPlasticity::ClosestPointProjection
enum  TypesTags { W = 0 , Y , H , LAST_TAPE }
 
- Public Attributes inherited from ADOLCPlasticity::ParaboloidalPlasticity
FTensor::Index< 'i', 3 > i
 
FTensor::Index< 'j', 3 > j
 
FTensor::Index< 'Z', 6 > Z
 
FTensor::Tensor2_symmetric< adouble, 3 > tTotalStrain
 
FTensor::Tensor2_symmetric< adouble, 3 > tPlasticStrain
 
FTensor::Tensor2_symmetric< adouble, 3 > tElasticStrain
 
FTensor::Tensor2_symmetric< adouble, 3 > tStress
 
FTensor::Tensor2_symmetric< adouble, 3 > tDeviator
 
adouble tR
 
double lambda
 
double mu
 
double nup
 
double Ht
 
double Hc
 
double sigmaYt
 
double sigmaYc
 
double nt
 
double nc
 
boost::shared_ptr< ParamsArray > defaultParamsArrayPtr = nullptr
 
boost::shared_ptr< ParamsArray > paramsArrayPtr = nullptr
 
boost::shared_ptr< ParamsArray > oldParamsArrayPtr = nullptr
 
adouble I1
 
adouble J2
 
- Public Attributes inherited from ADOLCPlasticity::ClosestPointProjection
int nbInternalVariables
 
boost::function< int(int, int, int)> integrationRule
 
VectorDouble internalVariables0
 
VectorDouble plasticStrain0
 
std::array< int, LAST_TAPE > tapesTags
 
VectorAdaptor activeVariablesW
 
VectorAdaptor gradientW
 
double w
 
double y
 
double h
 
double deltaGamma
 
MatrixDouble Ep
 
MatrixDouble Cp
 
MatrixDouble Cep
 
ublas::symmetric_matrix< double, ublas::lower > C
 
ublas::symmetric_matrix< double, ublas::lower > D
 
PetscBool implHessianW
 
MatrixDouble hessianW
 
VectorDouble gradientY
 
VectorDouble gradientH
 
MatrixDouble hessianH
 
MatrixDouble partialWStrainPlasticStrain
 
VectorAdaptor partialYSigma
 
VectorAdaptor partialYFlux
 
VectorAdaptor partialHSigma
 
VectorAdaptor partialHFlux
 
ublas::symmetric_matrix< double, ublas::lower > partial2HSigma
 
ublas::symmetric_matrix< double, ublas::lower > partial2HFlux
 
MatrixDouble partial2HSigmaFlux
 
SmartPetscObj< Mat > A
 
SmartPetscObj< Vec > R
 
SmartPetscObj< Vec > Chi
 
SmartPetscObj< Vec > dChi
 
ublas::matrix< double, ublas::column_major > dataA
 
SmartPetscObj< SNES > sNes
 
ublas::vector< adouble > a_sTrain
 
ublas::vector< adouble > a_plasticStrain
 
ublas::vector< adouble > a_internalVariables
 
ublas::vector< adouble > a_sTress
 
ublas::vector< adouble > a_internalFluxes
 
adouble a_w
 
adouble a_y
 
adouble a_h
 

Detailed Description

Definition at line 1008 of file ADOLCPlasticityMaterialModels.hpp.

Member Function Documentation

◆ addMatBlockOps()

MoFEMErrorCode ADOLCPlasticity::HeterogeneousParaboloidalPlasticity::addMatBlockOps ( MoFEM::Interface &  m_field,
boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &  pip,
std::string  block_name,
Sev  sev 
)
inlineoverridevirtual

Get model parameters from blocks.

Reimplemented from ADOLCPlasticity::ClosestPointProjection.

Examples
/home/lk58p/mofem_install/vanilla_dev_release/mofem-cephas/mofem/users_modules/adolc-plasticity/src/ADOLCPlasticityMaterialModels.hpp.

Definition at line 1013 of file ADOLCPlasticityMaterialModels.hpp.

1015 {
1017
1018 struct OpMatBlocks : public ForcesAndSourcesCore::UserDataOperator {
1019
1020 using OP = ForcesAndSourcesCore::UserDataOperator;
1021
1022 double poissonRatio = 0.25;
1023 Tag thYoungModulus;
1024 Tag thCompressiveYieldStress;
1025 Tag thTensionYieldStress;
1026 double youngsModulus;
1027 double yieldStrengthC;
1028 double yieldStrengthT;
1029
1030 OpMatBlocks(boost::shared_ptr<ParamsArray> params_array_ptr,
1031 boost::shared_ptr<ParamsArray> def_params_array_ptr,
1032 MoFEM::Interface &m_field, Sev sev,
1033 std::vector<const CubitMeshSets *> meshset_vec_ptr)
1034 : OP(NOSPACE, OP::OPSPACE), paramsArrayPtr(params_array_ptr),
1035 defParamsArray(def_params_array_ptr), mField(m_field) {
1036 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-poisson_ratio",
1037 &poissonRatio, 0);
1038 rval = mField.get_moab().tag_get_handle(
1039 "YOUNGS_MODULUS", 1, MB_TYPE_DOUBLE, thYoungModulus, MB_TAG_SPARSE);
1040 if (rval != MB_SUCCESS) {
1041 MOFEM_LOG("ADOLCPlasticityWold", Sev::warning)
1042 << "YOUNGS_MODULUS tag does not exist using default value";
1043 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "-young_modulus",
1044 &youngsModulus, 0);
1045 }
1046
1047 rval = mField.get_moab().tag_get_handle(
1048 "Yield_Strength_C", 1, MB_TYPE_DOUBLE, thCompressiveYieldStress,
1049 MB_TAG_SPARSE);
1050
1051 if (rval != MB_SUCCESS) {
1052 MOFEM_LOG("ADOLCPlasticityWold", Sev::warning)
1053 << "Yield_Strength_C tag does not exist using default value";
1054 yieldStrengthC = defParamsArray->at(SIGMA_YC);
1055 }
1056
1057 rval = mField.get_moab().tag_get_handle(
1058 "Yield_Strength_T", 1, MB_TYPE_DOUBLE, thTensionYieldStress,
1059 MB_TAG_SPARSE);
1060
1061 if (rval != MB_SUCCESS) {
1062 MOFEM_LOG("ADOLCPlasticityWold", Sev::warning)
1063 << "Yield_Strength_T tag does not exist using default value";
1064 yieldStrengthT = defParamsArray->at(SIGMA_YT);
1065 }
1066
1067 CHK_THROW_MESSAGE(extractBlockData(m_field, meshset_vec_ptr, sev),
1068 "Can not get data from block");
1069 }
1070
1071 MoFEMErrorCode doWork(int side, EntityType type,
1072 EntitiesFieldData::EntData &data) {
1074
1075 for (auto &b : blockData) {
1076
1077 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
1078 EntityHandle fe_ent = getFEEntityHandle();
1079
1080 if (thYoungModulus != 0)
1081 CHKERR mField.get_moab().tag_get_data(thYoungModulus, &fe_ent, 1,
1082 &youngsModulus);
1083
1084 if (thCompressiveYieldStress != 0)
1085 CHKERR mField.get_moab().tag_get_data(
1086 thCompressiveYieldStress, &fe_ent, 1, &yieldStrengthC);
1087
1088 if (thTensionYieldStress != 0)
1089 CHKERR mField.get_moab().tag_get_data(
1090 thTensionYieldStress, &fe_ent, 1, &yieldStrengthT);
1091
1092 std::copy(b.paramsArray.begin(), b.paramsArray.end(),
1093 paramsArrayPtr->begin());
1094
1095 (*paramsArrayPtr)[LAMBDA] = LAMBDA(youngsModulus, poissonRatio);
1096 (*paramsArrayPtr)[MU] = MU(youngsModulus, poissonRatio);
1097 (*paramsArrayPtr)[SIGMA_YC] = yieldStrengthC;
1098 (*paramsArrayPtr)[SIGMA_YT] = yieldStrengthT;
1099
1101 }
1102 }
1103
1104 std::copy(defParamsArray->begin(), defParamsArray->end(),
1105 paramsArrayPtr->begin());
1106
1108 }
1109
1110 private:
1111 boost::shared_ptr<ParamsArray> paramsArrayPtr;
1112 boost::shared_ptr<ParamsArray> defParamsArray;
1114
1115 struct BlockData {
1116 ParamsArray paramsArray;
1117 Range blockEnts;
1118 };
1119
1120 std::vector<BlockData> blockData;
1121
1123 extractBlockData(MoFEM::Interface &m_field,
1124 std::vector<const CubitMeshSets *> meshset_vec_ptr,
1125 Sev sev) {
1127
1128 for (auto m : meshset_vec_ptr) {
1129 MOFEM_TAG_AND_LOG("ADOLCPlasticityWold", sev,
1130 "Heterogeneous Paraboloidal")
1131 << *m;
1132 std::vector<double> block_data;
1133 CHKERR m->getAttributes(block_data);
1134 if (block_data.size() != 0) {
1135 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1136 "Expected that block has zero attributes");
1137 }
1138 auto get_block_ents = [&]() {
1139 Range ents;
1140 CHKERR
1141 m_field.get_moab().get_entities_by_handle(m->meshset, ents, true);
1142 return ents;
1143 };
1144
1145 blockData.push_back({*defParamsArray, get_block_ents()});
1146 std::copy(block_data.begin(), block_data.end(),
1147 blockData.back().paramsArray.begin());
1148 const auto young_modulus = blockData.back().paramsArray[LAMBDA];
1149 const auto poisson_ratio = blockData.back().paramsArray[MU];
1150
1151 // It is assumed that user provide young_modulus and poisson_ratio in
1152 // first two arguments of the block
1153
1154 MOFEM_LOG("ADOLCPlasticityWold", sev)
1155 << "Young modulus: " << (blockData.back().paramsArray)[LAMBDA];
1156 MOFEM_LOG("ADOLCPlasticityWold", sev)
1157 << "Poisson ratio: " << (blockData.back().paramsArray)[MU];
1158
1159 blockData.back().paramsArray[LAMBDA] =
1161 blockData.back().paramsArray[MU] = MU(young_modulus, poisson_ratio);
1162
1163 MOFEM_LOG("ADOLCPlasticityWold", sev)
1164 << "LAMBDA: " << (blockData.back().paramsArray)[LAMBDA];
1165 MOFEM_LOG("ADOLCPlasticityWold", sev)
1166 << "MU: " << (blockData.back().paramsArray)[MU];
1167 MOFEM_LOG("ADOLCPlasticityWold", sev)
1168 << "NUP: " << (blockData.back().paramsArray)[NUP];
1169 MOFEM_LOG("ADOLCPlasticityWold", sev)
1170 << "SIGMA_YT: " << (blockData.back().paramsArray)[SIGMA_YT];
1171 MOFEM_LOG("ADOLCPlasticityWold", sev)
1172 << "SIGMA_YC: " << (blockData.back().paramsArray)[SIGMA_YC];
1173 MOFEM_LOG("ADOLCPlasticityWold", sev)
1174 << "HT: " << (blockData.back().paramsArray)[HT];
1175 MOFEM_LOG("ADOLCPlasticityWold", sev)
1176 << "HC: " << (blockData.back().paramsArray)[HC];
1177 MOFEM_LOG("ADOLCPlasticityWold", sev)
1178 << "NT: " << (blockData.back().paramsArray)[NT];
1179 MOFEM_LOG("ADOLCPlasticityWold", sev)
1180 << "NC: " << (blockData.back().paramsArray)[NC];
1181 }
1183 }
1184 };
1185
1186 auto cubit_meshsets_vec_ptr =
1187 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
1188 std::regex((boost::format("%s(.*)") % block_name).str()));
1189
1190 pip.push_back(new OpMatBlocks(paramsArrayPtr, defaultParamsArrayPtr,
1191 m_field, sev, cubit_meshsets_vec_ptr));
1192
1194 }
MoFEM::Interface & mField
std::string type
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#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()
@ NOSPACE
Definition definitions.h:83
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MU(E, NU)
Definition fem_tools.h:23
#define LAMBDA(E, NU)
Definition fem_tools.h:22
#define MOFEM_LOG(channel, severity)
Log.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
double young_modulus
Young modulus.
Definition plastic.cpp:126
double poisson_ratio
Poisson ratio.
Definition plastic.cpp:127
FTensor::Index< 'm', 3 > m
virtual moab::Interface & get_moab()=0
Deprecated interface functions.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.

◆ ParaboloidalPlasticity()

ADOLCPlasticity::ParaboloidalPlasticity::ParaboloidalPlasticity ( )
inline

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