v0.14.0
Classes | Functions
SmallStrainPlasticity.hpp File Reference

Operators and data structures for small strain plasticity. More...

Go to the source code of this file.

Classes

struct  SmallStrainPlasticity
 Small strain finite element implementation. More...
 
struct  SmallStrainPlasticity::MyVolumeFE
 definition of volume element More...
 
struct  SmallStrainPlasticity::CommonData
 common data used by volume elements More...
 
struct  SmallStrainPlasticity::OpGetDataAtGaussPts
 
struct  SmallStrainPlasticity::OpGetCommonDataAtGaussPts
 
struct  SmallStrainPlasticity::OpUpdate
 
struct  SmallStrainPlasticity::MakeB
 
struct  SmallStrainPlasticity::OpAssembleRhs
 
struct  SmallStrainPlasticity::OpAssembleLhs
 
struct  SmallStrainPlasticity::ClosestPointProjection
 Closest point projection algorithm. More...
 
struct  SmallStrainPlasticity::OpCalculateStress
 

Functions

PetscErrorCode SmallStrainPlasticityfRes (SNES snes, Vec chi, Vec r, void *ctx)
 
PetscErrorCode SmallStrainPlasticityfJac (SNES, Vec, Mat, Mat, void *ctx)
 

Detailed Description

Operators and data structures for small strain plasticity.

Definition in file SmallStrainPlasticity.hpp.

Function Documentation

◆ SmallStrainPlasticityfJac()

PetscErrorCode SmallStrainPlasticityfJac ( SNES  ,
Vec  ,
Mat  ,
Mat  ,
void *  ctx 
)
Examples
SmallStrainPlasticity.hpp.

Definition at line 1207 of file SmallStrainPlasticity.cpp.

1207  {
1208  PetscFunctionBegin;
1211 
1212  {
1213  #if PETSC_VERSION_GE(3,6,0)
1214  const double *array;
1215  ierr = VecGetArrayRead(chi,&array); CHKERRQ(ierr);
1216  #else
1217  double *array;
1218  ierr = VecGetArray(chi,&array); CHKERRQ(ierr);
1219  #endif
1220  for(int ii = 0;ii<6;ii++) {
1221  cp->plasticStrain[ii] = array[ii];
1222  }
1223  for(unsigned int ii = 0;ii<cp->internalVariables.size();ii++) {
1224  cp->internalVariables[ii] = array[6+ii];
1225  }
1226  cp->deltaGamma = array[6+cp->internalVariables.size()];
1227  #if PETSC_VERSION_GE(3,6,0)
1228  ierr = VecRestoreArrayRead(chi,&array); CHKERRQ(ierr);
1229  #else
1230  ierr = VecRestoreArray(chi,&array); CHKERRQ(ierr);
1231  #endif
1232  }
1233  ierr = cp->evaluatePotentials(); CHKERRQ(ierr);
1234  ierr = cp->cAlculateA(); CHKERRQ(ierr);
1235  PetscFunctionReturn(0);
1236 }

◆ SmallStrainPlasticityfRes()

PetscErrorCode SmallStrainPlasticityfRes ( SNES  snes,
Vec  chi,
Vec  r,
void *  ctx 
)
Examples
SmallStrainPlasticity.hpp.

Definition at line 1154 of file SmallStrainPlasticity.cpp.

1154  {
1155  PetscFunctionBegin;
1158 
1159  //ierr = VecView(chi,PETSC_VIEWER_STDOUT_WORLD); CHKERRQ(ierr);
1160  {
1161  #if PETSC_VERSION_GE(3,6,0)
1162  const double *array;
1163  ierr = VecGetArrayRead(chi,&array); CHKERRQ(ierr);
1164  #else
1165  const double *array;
1166  ierr = VecGetArray(chi,&array); CHKERRQ(ierr);
1167  #endif
1168  for(int ii = 0;ii<6;ii++) {
1169  cp->plasticStrain[ii] = array[ii];
1170  }
1171  for(unsigned int ii = 0;ii<cp->internalVariables.size();ii++) {
1172  cp->internalVariables[ii] = array[6+ii];
1173  }
1174  cp->deltaGamma = array[6+cp->internalVariables.size()];
1175  #if PETSC_VERSION_GE(3,6,0)
1176  ierr = VecRestoreArrayRead(chi,&array); CHKERRQ(ierr);
1177  #else
1178  ierr = VecRestoreArray(chi,&array); CHKERRQ(ierr);
1179  #endif
1180  }
1181  ierr = cp->evaluatePotentials(); CHKERRQ(ierr);
1182  ierr = cp->cAlculateR(r); CHKERRQ(ierr);
1183  // ierr = VecView(r,PETSC_VIEWER_STDOUT_WORLD); CHKERRQ(ierr);
1184  // cout << "sTress " << cp->sTress << endl;
1185  // cout << "internalVariables " << cp->internalVariables << endl;
1186  // cout << "C " << cp->C << endl;
1187  // cout << "D " << cp->D << endl;
1188  // cout << "y " << cp->y << endl;
1189  // cout << "h " << cp->h << endl;
1190  // cout << "partialYSigma " << cp->partialYSigma << endl;
1191  // cout << "partialYFlux " << cp->partialYFlux << endl;
1192  // cout << "partialHSigma " << cp->partialHSigma << endl;
1193  // cout << "partialHFlux " << cp->partialHFlux << endl;
1194  // cout << "partial2HSigma " << cp->partial2HSigma << endl;
1195  // cout << "partial2HFlux " << cp->partial2HFlux << endl;
1196  // cout << "partial2HSigmaFlux " << cp->partial2HSigmaFlux << endl;
1197  // cout << "C " << cp->C << endl;
1198  // cout << "D " << cp->D << endl;
1199  // cout << "partialWStrainPlasticStrain " << cp->partialWStrainPlasticStrain << endl;
1200  // cout << "plasticStrain " << cp->plasticStrain << endl;
1201  // cout << "internalVariables " << cp->internalVariables << endl;
1202  // cout << "delta plasticStrain " << cp->plasticStrain-cp->plasticStrain0 << endl;
1203  // cout << "delta internalVariables " << cp->internalVariables-cp->internalVariables << endl;
1204  PetscFunctionReturn(0);
1205 }
SmallStrainPlasticity::ClosestPointProjection::evaluatePotentials
virtual PetscErrorCode evaluatePotentials()
Definition: SmallStrainPlasticity.cpp:945
SmallStrainPlasticity::ClosestPointProjection::plasticStrain
VectorDouble plasticStrain
Definition: SmallStrainPlasticity.hpp:489
SmallStrainPlasticity::ClosestPointProjection
Closest point projection algorithm.
Definition: SmallStrainPlasticity.hpp:482
sdf.r
int r
Definition: sdf.py:8
SmallStrainPlasticity::ClosestPointProjection::internalVariables
VectorDouble internalVariables
Definition: SmallStrainPlasticity.hpp:486
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
SmallStrainPlasticity::ClosestPointProjection::cAlculateR
virtual PetscErrorCode cAlculateR(Vec R)
Definition: SmallStrainPlasticity.cpp:962
SmallStrainPlasticity::ClosestPointProjection::deltaGamma
double deltaGamma
Definition: SmallStrainPlasticity.hpp:490
SmallStrainPlasticity::ClosestPointProjection::cAlculateA
virtual PetscErrorCode cAlculateA()
Definition: SmallStrainPlasticity.cpp:978