48 auto cp_ptr = createMaterial<ParaboloidalPlasticity>();
50 VectorDouble active_variables(12 + cp_ptr->nbInternalVariables);
54 12 + cp_ptr->nbInternalVariables);
55 cp_ptr->activeVariablesW.swap(tmp_active);
58 cp_ptr->gradientW.swap(tmp_gradient);
60 auto strain = cp_ptr->getTotalStrain();
61 auto internal_variables = cp_ptr->getInternalVariables();
62 auto stress = cp_ptr->getStress();
63 auto plastic_strain = cp_ptr->getPlasticStrain();
65 cp_ptr->createMatAVecR();
71 for (
int ii = 0; ii <
N; ii++) {
72 cout <<
"Step " << ii << endl;
75 strain[idx] += +alpha;
77 }
else if (ii <= 100) {
78 strain[idx] += -alpha;
81 strain[idx] += +alpha;
84 cp_ptr->plasticStrain0 = plastic_strain;
85 cp_ptr->internalVariables0 = internal_variables;
86 CHKERR VecSetValue(cp_ptr->Chi, 6 + cp_ptr->nbInternalVariables, 0,
88 CHKERR VecAssemblyBegin(cp_ptr->Chi);
89 CHKERR VecAssemblyEnd(cp_ptr->Chi);
94 bool nonlinear =
false;
95 if (cp_ptr->y >
tol) {
97 CHKERR cp_ptr->solveClosetProjection();
100 cout <<
"plot " << strain[idx] <<
" " << stress[idx] <<
" "
101 << internal_variables[0] <<
" " << plastic_strain[idx] <<
" "
102 << cp_ptr->deltaGamma << endl;
105 CHKERR cp_ptr->consistentTangent();
107 cerr <<
"Cep " << cp_ptr->Cep << endl;
110 const double eps = 1e-6;
111 for (
int ii = 0; ii < 6; ii++) {
114 CHKERR cp_ptr->solveClosetProjection();
115 for (
int dd = 0;
dd < 6;
dd++) {
116 e(
dd, ii) += stress[
dd] / (2 *
eps);
120 CHKERR cp_ptr->solveClosetProjection();
121 for (
int dd = 0;
dd < 6;
dd++) {
122 e(
dd, ii) -= stress[
dd] / (2 *
eps);
126 cerr <<
"e " << e << endl;