|
| v0.14.0
|
Closest point projection algorithm.
More...
#include <users_modules/adolc-plasticity/src/ADOLCPlasticity.hpp>
Closest point projection algorithm.
Definition at line 139 of file ADOLCPlasticity.hpp.
◆ TypesTags
◆ ClosestPointProjection()
ADOLCPlasticity::ClosestPointProjection::ClosestPointProjection |
( |
| ) |
|
- Examples
- ADOLCPlasticity.hpp, and ADOLCPlasticityMaterialModels.hpp.
Definition at line 15 of file ClosetPointProjection.cpp.
17 if (!LogManager::checkIfChannelExist(
"ADOLCPlasticityWold")) {
18 auto core_log = logging::core::get();
20 core_log->add_sink(LogManager::createSink(LogManager::getStrmWorld(),
21 "ADOLCPlasticityWold"));
22 core_log->add_sink(LogManager::createSink(LogManager::getStrmSync(),
23 "ADOLCPlasticitySync"));
24 core_log->add_sink(LogManager::createSink(LogManager::getStrmSelf(),
25 "ADOLCPlasticitySelf"));
27 LogManager::setLog(
"ADOLCPlasticityWold");
28 LogManager::setLog(
"ADOLCPlasticitySync");
29 LogManager::setLog(
"ADOLCPlasticitySelf");
◆ addMatBlockOps()
◆ calculateA()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::calculateA |
( |
| ) |
|
- Examples
- ADOLCPlasticity.hpp.
Definition at line 382 of file ClosetPointProjection.cpp.
389 for (
int ii = 0; ii < 6; ii++) {
390 for (
int jj = 0; jj < 6; jj++) {
398 for (
int ii = 0; ii < 6; ii++) {
406 for (
int jj = 0; jj < 6; jj++) {
412 dataA(6 + ii, 6 + ii) -= 1;
421 for (
unsigned int dd = 0;
dd < partial_y_sigma_c.size();
dd++) {
424 for (
unsigned int dd = 0;
dd < partial_y_flux_d.size();
dd++) {
428 CHKERR MatAssemblyBegin(
A, MAT_FINAL_ASSEMBLY);
429 CHKERR MatAssemblyEnd(
A, MAT_FINAL_ASSEMBLY);
◆ calculateR()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::calculateR |
( |
Vec |
R | ) |
|
◆ consistentTangent()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::consistentTangent |
( |
| ) |
|
Calculate consistent tangent matrix.
- Examples
- ADOLCPlasticity.hpp.
Definition at line 509 of file ClosetPointProjection.cpp.
513 Ep.resize(6, 6,
false);
523 for (
int dd = 0;
dd < 6;
dd++) {
528 for (
auto ii = 0; ii < 6; ii++) {
529 array[ii] = ep_row(ii,
dd);
532 array[6 + ii] = alpha_row(ii,
dd);
534 array[
n] = y_row[
dd];
536 CHKERR VecRestoreArray(
R, &array);
545 for (
auto ii = 0; ii < 6; ii++) {
546 Ep(ii,
dd) = array[ii];
551 Cp.resize(6, 6,
false);
552 noalias(
Cp) = prod(
C,
Ep);
553 Cep.resize(6, 6,
false);
◆ createMatAVecR()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::createMatAVecR |
( |
| ) |
|
- Examples
- ADOLCPlasticity.hpp.
Definition at line 314 of file ClosetPointProjection.cpp.
320 Vec R_tmp, Chi_tmp, dChi_tmp;
321 CHKERR MatCreateSeqDense(PETSC_COMM_SELF,
n,
n, &
dataA(0, 0), &A_tmp);
322 CHKERR VecCreateSeq(PETSC_COMM_SELF,
n, &R_tmp);
323 CHKERR VecCreateSeq(PETSC_COMM_SELF,
n, &Chi_tmp);
324 CHKERR VecCreateSeq(PETSC_COMM_SELF,
n, &dChi_tmp);
◆ evaluatePotentials()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::evaluatePotentials |
( |
| ) |
|
◆ flowPotential()
virtual MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::flowPotential |
( |
| ) |
|
|
pure virtual |
◆ freeHemholtzEnergy()
virtual MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::freeHemholtzEnergy |
( |
| ) |
|
|
pure virtual |
◆ getActiveVariablesYH()
VectorAdaptor ADOLCPlasticity::ClosestPointProjection::getActiveVariablesYH |
( |
| ) |
|
|
inline |
◆ getInternalFluxes()
VectorAdaptor ADOLCPlasticity::ClosestPointProjection::getInternalFluxes |
( |
| ) |
|
|
inline |
◆ getInternalVariables()
VectorAdaptor ADOLCPlasticity::ClosestPointProjection::getInternalVariables |
( |
| ) |
|
|
inline |
◆ getPlasticStrain()
VectorAdaptor ADOLCPlasticity::ClosestPointProjection::getPlasticStrain |
( |
| ) |
|
|
inline |
◆ getStress()
VectorAdaptor ADOLCPlasticity::ClosestPointProjection::getStress |
( |
| ) |
|
|
inline |
◆ getTotalStrain()
VectorAdaptor ADOLCPlasticity::ClosestPointProjection::getTotalStrain |
( |
| ) |
|
|
inline |
◆ playH()
- Examples
- ADOLCPlasticity.hpp.
Definition at line 230 of file ClosetPointProjection.cpp.
234 int adloc_return_value = 0;
236 active_variables_yh.size(), &active_variables_yh[0], &
h);
237 if (
r < adloc_return_value) {
239 "ADOL-C function evaluation with error");
241 gradientH.resize(active_variables_yh.size());
244 if (
r < adloc_return_value) {
246 "ADOL-C function evaluation with error");
250 vector<double *> hessian_h(active_variables_yh.size());
251 for (
int dd = 0;
dd < active_variables_yh.size();
dd++) {
255 &active_variables_yh[0], &hessian_h[0]);
256 if (
r < adloc_return_value) {
258 "ADOL-C function evaluation with error");
267 for (
int ii = 0; ii < 6; ii++) {
268 for (
int jj = 0; jj <= ii; jj++) {
274 for (
unsigned int jj = 0; jj <= ii; jj++) {
280 for (
int ii = 0; ii < 6; ii++) {
◆ playH_NoHessian()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::playH_NoHessian |
( |
| ) |
|
- Examples
- ADOLCPlasticity.hpp.
Definition at line 287 of file ClosetPointProjection.cpp.
291 int adloc_return_value = 0;
293 active_variables_yh.size(), &active_variables_yh[0], &
h);
294 if (
r < adloc_return_value) {
296 "ADOL-C function evaluation with error");
298 gradientH.resize(active_variables_yh.size());
301 if (
r < adloc_return_value) {
303 "ADOL-C function evaluation with error");
◆ playPotentials()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::playPotentials |
( |
| ) |
|
◆ playPotentials_NoHessian()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::playPotentials_NoHessian |
( |
| ) |
|
◆ playW()
- Examples
- ADOLCPlasticity.hpp.
Definition at line 122 of file ClosetPointProjection.cpp.
125 int adloc_return_value = 0;
128 if (
r < adloc_return_value) {
130 "ADOL-C function evaluation with error");
134 if (
r < adloc_return_value) {
136 "ADOL-C function evaluation with error");
146 if (
r < adloc_return_value) {
148 "ADOL-C function evaluation with error");
151 for (
int ii = 0; ii < 6; ii++) {
152 for (
int jj = 0; jj < 6; jj++) {
156 C.resize(6, 6,
false);
157 for (
int ii = 0; ii < 6; ii++) {
158 for (
int jj = 0; jj <= ii; jj++) {
164 for (
unsigned int jj = 0; jj <= ii; jj++) {
◆ playW_NoHessian()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::playW_NoHessian |
( |
| ) |
|
- Examples
- ADOLCPlasticity.hpp.
Definition at line 172 of file ClosetPointProjection.cpp.
175 int adloc_return_value = 0;
178 if (
r < adloc_return_value) {
180 "ADOL-C function evaluation with error");
184 if (
r < adloc_return_value) {
186 "ADOL-C function evaluation with error");
◆ playY()
- Examples
- ADOLCPlasticity.hpp.
Definition at line 191 of file ClosetPointProjection.cpp.
195 int adloc_return_value = 0;
197 active_variables_yh.size(), &active_variables_yh[0], &
y);
198 if (
r < adloc_return_value) {
200 "ADOL-C function evaluation with error");
202 gradientY.resize(active_variables_yh.size());
205 if (
r < adloc_return_value) {
207 "ADOL-C function evaluation with error");
◆ playY_NoGradient()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::playY_NoGradient |
( |
| ) |
|
- Examples
- ADOLCPlasticity.hpp.
Definition at line 217 of file ClosetPointProjection.cpp.
221 int adloc_return_value = 0;
223 active_variables_yh.size(), &active_variables_yh[0], &
y);
224 if (
r < adloc_return_value) {
226 "ADOL-C function evaluation with error");
◆ recordH()
◆ recordTapes()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::recordTapes |
( |
| ) |
|
◆ recordW()
◆ recordY()
◆ setParams()
virtual MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::setParams |
( |
short |
tag, |
|
|
bool & |
recalculate_elastic_tangent |
|
) |
| |
|
inlinevirtual |
◆ snesCreate()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::snesCreate |
( |
| ) |
|
◆ solveClosetProjection()
MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::solveClosetProjection |
( |
| ) |
|
Solve nonlinear system of equations to find stress, internal fluxes, and Lagrange plastic multiplier.
- Examples
- ADOLCPlasticity.hpp.
Definition at line 459 of file ClosetPointProjection.cpp.
468 for (
int ii = 0; ii < 6; ii++) {
469 array[ii] = plastic_strain[ii];
472 for (
unsigned int ii = 0; ii < nb_internal_variables; ii++) {
473 array[6 + ii] = internal_variables[ii];
480 SNESConvergedReason reason;
486 "ADOLCPlasticitySelf", Sev::warning,
487 "Plasticity Closet Point Projection - number of Newton iterations = %d",
495 for (
int ii = 0; ii < 6; ii++) {
496 plastic_strain[ii] = array[ii];
499 for (
unsigned int ii = 0; ii < nb_internal_variables; ii++) {
500 internal_variables[ii] = array[6 + ii];
502 deltaGamma = array[6 + nb_internal_variables];
◆ yieldFunction()
virtual MoFEMErrorCode ADOLCPlasticity::ClosestPointProjection::yieldFunction |
( |
| ) |
|
|
pure virtual |
◆ ADOLCPlasticityJac
MoFEMErrorCode ADOLCPlasticityJac |
( |
SNES |
snes, |
|
|
Vec |
chi, |
|
|
Mat |
A, |
|
|
Mat |
, |
|
|
void * |
ctx |
|
) |
| |
|
friend |
Function executed by nested SENES at evaluationg tangent matrix.
- Examples
- ADOLCPlasticity.hpp.
Definition at line 584 of file ClosetPointProjection.cpp.
590 auto plastic_strain = cp->getPlasticStrain();
591 auto internal_variables = cp->getInternalVariables();
595 CHKERR VecGetArrayRead(chi, &array);
596 for (
auto ii = 0; ii < 6; ii++) {
597 plastic_strain[ii] = array[ii];
599 for (
auto ii = 0; ii < cp->nbInternalVariables; ii++) {
600 internal_variables[ii] = array[6 + ii];
602 cp->deltaGamma = array[6 + cp->nbInternalVariables];
603 CHKERR VecRestoreArrayRead(chi, &array);
605 CHKERR cp->playPotentials();
◆ ADOLCPlasticityRes
MoFEMErrorCode ADOLCPlasticityRes |
( |
SNES |
snes, |
|
|
Vec |
chi, |
|
|
Vec |
r, |
|
|
void * |
ctx |
|
) |
| |
|
friend |
Function executed by nested SENES at evaluationg residual.
- Examples
- ADOLCPlasticity.hpp.
Definition at line 558 of file ClosetPointProjection.cpp.
563 auto plastic_strain = cp->getPlasticStrain();
564 auto internal_variables = cp->getInternalVariables();
568 CHKERR VecGetArrayRead(chi, &array);
569 for (
auto ii = 0; ii < 6; ii++) {
570 plastic_strain[ii] = array[ii];
572 for (
auto ii = 0; ii < cp->nbInternalVariables; ii++) {
573 internal_variables[ii] = array[6 + ii];
575 cp->deltaGamma = array[6 + cp->nbInternalVariables];
576 CHKERR VecRestoreArrayRead(chi, &array);
578 CHKERR cp->playPotentials_NoHessian();
SmartPetscObj<Mat> ADOLCPlasticity::ClosestPointProjection::A |
◆ a_h
adouble ADOLCPlasticity::ClosestPointProjection::a_h |
◆ a_internalFluxes
ublas::vector<adouble> ADOLCPlasticity::ClosestPointProjection::a_internalFluxes |
◆ a_internalVariables
ublas::vector<adouble> ADOLCPlasticity::ClosestPointProjection::a_internalVariables |
◆ a_plasticStrain
ublas::vector<adouble> ADOLCPlasticity::ClosestPointProjection::a_plasticStrain |
◆ a_sTrain
ublas::vector<adouble> ADOLCPlasticity::ClosestPointProjection::a_sTrain |
◆ a_sTress
ublas::vector<adouble> ADOLCPlasticity::ClosestPointProjection::a_sTress |
◆ a_w
adouble ADOLCPlasticity::ClosestPointProjection::a_w |
◆ a_y
adouble ADOLCPlasticity::ClosestPointProjection::a_y |
◆ activeVariablesW
VectorAdaptor ADOLCPlasticity::ClosestPointProjection::activeVariablesW |
ublas::symmetric_matrix<double, ublas::lower> ADOLCPlasticity::ClosestPointProjection::C |
◆ Cep
MatrixDouble ADOLCPlasticity::ClosestPointProjection::Cep |
◆ Chi
SmartPetscObj<Vec> ADOLCPlasticity::ClosestPointProjection::Chi |
◆ Cp
MatrixDouble ADOLCPlasticity::ClosestPointProjection::Cp |
ublas::symmetric_matrix<double, ublas::lower> ADOLCPlasticity::ClosestPointProjection::D |
◆ dataA
ublas::matrix<double, ublas::column_major> ADOLCPlasticity::ClosestPointProjection::dataA |
◆ dChi
SmartPetscObj<Vec> ADOLCPlasticity::ClosestPointProjection::dChi |
◆ deltaGamma
double ADOLCPlasticity::ClosestPointProjection::deltaGamma |
◆ Ep
MatrixDouble ADOLCPlasticity::ClosestPointProjection::Ep |
◆ gradientH
VectorDouble ADOLCPlasticity::ClosestPointProjection::gradientH |
◆ gradientW
VectorAdaptor ADOLCPlasticity::ClosestPointProjection::gradientW |
◆ gradientY
VectorDouble ADOLCPlasticity::ClosestPointProjection::gradientY |
double ADOLCPlasticity::ClosestPointProjection::h |
◆ hessianH
MatrixDouble ADOLCPlasticity::ClosestPointProjection::hessianH |
◆ hessianW
MatrixDouble ADOLCPlasticity::ClosestPointProjection::hessianW |
◆ integrationRule
boost::function<int(int, int, int)> ADOLCPlasticity::ClosestPointProjection::integrationRule |
◆ internalVariables0
VectorDouble ADOLCPlasticity::ClosestPointProjection::internalVariables0 |
◆ nbInternalVariables
int ADOLCPlasticity::ClosestPointProjection::nbInternalVariables |
◆ partial2HFlux
ublas::symmetric_matrix<double, ublas::lower> ADOLCPlasticity::ClosestPointProjection::partial2HFlux |
◆ partial2HSigma
ublas::symmetric_matrix<double, ublas::lower> ADOLCPlasticity::ClosestPointProjection::partial2HSigma |
◆ partial2HSigmaFlux
MatrixDouble ADOLCPlasticity::ClosestPointProjection::partial2HSigmaFlux |
◆ partialHFlux
VectorAdaptor ADOLCPlasticity::ClosestPointProjection::partialHFlux |
◆ partialHSigma
VectorAdaptor ADOLCPlasticity::ClosestPointProjection::partialHSigma |
◆ partialWStrainPlasticStrain
MatrixDouble ADOLCPlasticity::ClosestPointProjection::partialWStrainPlasticStrain |
◆ partialYFlux
VectorAdaptor ADOLCPlasticity::ClosestPointProjection::partialYFlux |
◆ partialYSigma
VectorAdaptor ADOLCPlasticity::ClosestPointProjection::partialYSigma |
◆ plasticStrain0
VectorDouble ADOLCPlasticity::ClosestPointProjection::plasticStrain0 |
SmartPetscObj<Vec> ADOLCPlasticity::ClosestPointProjection::R |
◆ sNes
SmartPetscObj<SNES> ADOLCPlasticity::ClosestPointProjection::sNes |
◆ tapesTags
std::array<int, LAST_TAPE> ADOLCPlasticity::ClosestPointProjection::tapesTags |
double ADOLCPlasticity::ClosestPointProjection::w |
double ADOLCPlasticity::ClosestPointProjection::y |
The documentation for this struct was generated from the following files:
VectorAdaptor getActiveVariablesYH()
MoFEMErrorCode playW_NoHessian()
VectorAdaptor getInternalVariables()
virtual MoFEMErrorCode flowPotential()=0
Set flow potential.
MatrixDouble partial2HSigmaFlux
VectorDouble plasticStrain0
MoFEMErrorCode playH_NoHessian()
auto createSNES(MPI_Comm comm)
ublas::vector< adouble > a_plasticStrain
MoFEMErrorCode evaluatePotentials()
UBlasMatrix< double > MatrixDouble
ublas::vector< adouble > a_sTrain
VectorAdaptor partialYFlux
MatrixDouble partialWStrainPlasticStrain
SmartPetscObj< Vec > dChi
MoFEMErrorCode recordY()
Record yield function.
#define CHKERR
Inline error check.
VectorAdaptor getPlasticStrain()
MoFEMErrorCode playPotentials()
auto getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
#define MOFEM_LOG_C(channel, severity, format,...)
VectorAdaptor getStress()
VectorAdaptor getInternalFluxes()
ublas::symmetric_matrix< double, ublas::lower > partial2HFlux
VectorAdaptor partialYSigma
@ MOFEM_OPERATION_UNSUCCESSFUL
ublas::matrix< double, ublas::column_major > dataA
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
VectorAdaptor partialHSigma
VectorShallowArrayAdaptor< double > VectorAdaptor
ublas::vector< adouble > a_internalFluxes
VectorAdaptor activeVariablesW
std::array< int, LAST_TAPE > tapesTags
VectorAdaptor partialHFlux
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
friend MoFEMErrorCode ADOLCPlasticityRes(SNES, Vec, Vec, void *ctx)
Function executed by nested SENES at evaluationg residual.
SmartPetscObj< SNES > sNes
VectorAdaptor getTotalStrain()
ublas::vector< adouble > a_internalVariables
MoFEMErrorCode recordW()
Record strain energy.
const FTensor::Tensor2< T, Dim, Dim > Vec
MoFEMErrorCode calculateA()
ublas::vector< adouble > a_sTress
ublas::symmetric_matrix< double, ublas::lower > D
UBlasVector< double > VectorDouble
ublas::symmetric_matrix< double, ublas::lower > C
friend MoFEMErrorCode ADOLCPlasticityJac(SNES, Vec, Mat, Mat, void *ctx)
Function executed by nested SENES at evaluationg tangent matrix.
ublas::symmetric_matrix< double, ublas::lower > partial2HSigma
virtual MoFEMErrorCode freeHemholtzEnergy()=0
Set Hemholtz energy.
MoFEMErrorCode playY_NoGradient()
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
VectorDouble internalVariables0
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
virtual MoFEMErrorCode yieldFunction()=0
Set yield function.
MoFEMErrorCode recordH()
Record flow potential.