00001
00002
00003
00004
00005
00006 #include <Intrepid_FunctionSpaceTools.hpp>
00007 #include <Intrepid_MiniTensor.h>
00008 #include <Teuchos_TestForException.hpp>
00009 #include <Phalanx_DataLayout.hpp>
00010 #include <typeinfo>
00011
00012 namespace LCM
00013 {
00014
00015
00016 template<typename EvalT, typename Traits>
00017 CapExplicitModel<EvalT, Traits>::
00018 CapExplicitModel(Teuchos::ParameterList* p,
00019 const Teuchos::RCP<Albany::Layouts>& dl) :
00020 LCM::ConstitutiveModel<EvalT, Traits>(p, dl),
00021 A(p->get<RealType>("A")),
00022 B(p->get<RealType>("B")),
00023 C(p->get<RealType>("C")),
00024 theta(p->get<RealType>("theta")),
00025 R(p->get<RealType>("R")),
00026 kappa0(p->get<RealType>("kappa0")),
00027 W(p->get<RealType>("W")),
00028 D1(p->get<RealType>("D1")),
00029 D2(p->get<RealType>("D2")),
00030 calpha(p->get<RealType>("calpha")),
00031 psi(p->get<RealType>("psi")),
00032 N(p->get<RealType>("N")),
00033 L(p->get<RealType>("L")),
00034 phi(p->get<RealType>("phi")),
00035 Q(p->get<RealType>("Q"))
00036 {
00037
00038 this->dep_field_map_.insert(std::make_pair("Strain", dl->qp_tensor));
00039 this->dep_field_map_.insert(std::make_pair("Poissons Ratio", dl->qp_scalar));
00040 this->dep_field_map_.insert(std::make_pair("Elastic Modulus", dl->qp_scalar));
00041
00042
00043 std::string cauchy_string = (*field_name_map_)["Cauchy_Stress"];
00044 std::string strain_string = (*field_name_map_)["Strain"];
00045 std::string backStress_string = (*field_name_map_)["Back_Stress"];
00046 std::string capParameter_string = (*field_name_map_)["Cap_Parameter"];
00047 std::string eqps_string = (*field_name_map_)["eqps"];
00048 std::string volPlasticStrain_string = (*field_name_map_)["volPlastic_Strain"];
00049
00050
00051 this->eval_field_map_.insert(std::make_pair(cauchy_string, dl->qp_tensor));
00052 this->eval_field_map_.insert(
00053 std::make_pair(backStress_string, dl->qp_tensor));
00054 this->eval_field_map_.insert(
00055 std::make_pair(capParameter_string, dl->qp_scalar));
00056 this->eval_field_map_.insert(std::make_pair(eqps_string, dl->qp_scalar));
00057 this->eval_field_map_.insert(
00058 std::make_pair(volPlasticStrain_string, dl->qp_scalar));
00059 this->eval_field_map_.insert(
00060 std::make_pair("Material Tangent", dl->qp_tensor4));
00061
00062
00063
00064
00065 this->num_state_variables_++;
00066 this->state_var_names_.push_back(strain_string);
00067 this->state_var_layouts_.push_back(dl->qp_tensor);
00068 this->state_var_init_types_.push_back("scalar");
00069 this->state_var_init_values_.push_back(0.0);
00070 this->state_var_old_state_flags_.push_back(true);
00071 this->state_var_output_flags_.push_back(true);
00072
00073
00074 this->num_state_variables_++;
00075 this->state_var_names_.push_back(cauchy_string);
00076 this->state_var_layouts_.push_back(dl->qp_tensor);
00077 this->state_var_init_types_.push_back("scalar");
00078 this->state_var_init_values_.push_back(0.0);
00079 this->state_var_old_state_flags_.push_back(true);
00080 this->state_var_output_flags_.push_back(true);
00081
00082
00083 this->num_state_variables_++;
00084 this->state_var_names_.push_back(backStress_string);
00085 this->state_var_layouts_.push_back(dl->qp_tensor);
00086 this->state_var_init_types_.push_back("scalar");
00087 this->state_var_init_values_.push_back(0.0);
00088 this->state_var_old_state_flags_.push_back(true);
00089 this->state_var_output_flags_.push_back(true);
00090
00091
00092 this->num_state_variables_++;
00093 this->state_var_names_.push_back(capParameter_string);
00094 this->state_var_layouts_.push_back(dl->qp_scalar);
00095 this->state_var_init_types_.push_back("scalar");
00096 this->state_var_init_values_.push_back(kappa0);
00097 this->state_var_old_state_flags_.push_back(true);
00098 this->state_var_output_flags_.push_back(true);
00099
00100
00101 this->num_state_variables_++;
00102 this->state_var_names_.push_back(eqps_string);
00103 this->state_var_layouts_.push_back(dl->qp_scalar);
00104 this->state_var_init_types_.push_back("scalar");
00105 this->state_var_init_values_.push_back(0.0);
00106 this->state_var_old_state_flags_.push_back(true);
00107 this->state_var_output_flags_.push_back(true);
00108
00109
00110 this->num_state_variables_++;
00111 this->state_var_names_.push_back(volPlasticStrain_string);
00112 this->state_var_layouts_.push_back(dl->qp_scalar);
00113 this->state_var_init_types_.push_back("scalar");
00114 this->state_var_init_values_.push_back(0.0);
00115 this->state_var_old_state_flags_.push_back(true);
00116 this->state_var_output_flags_.push_back(true);
00117
00118
00119
00120 I = Intrepid::eye<ScalarT>(num_dims_);
00121 id1 = Intrepid::identity_1<ScalarT>(num_dims_);
00122 id2 = Intrepid::identity_2<ScalarT>(num_dims_);
00123 id3 = Intrepid::identity_3<ScalarT>(num_dims_);
00124 Celastic = Intrepid::Tensor4<ScalarT>(num_dims_);
00125 compliance = Intrepid::Tensor4<ScalarT>(num_dims_);
00126 depsilon = Intrepid::Tensor<ScalarT>(num_dims_);
00127 sigmaN = Intrepid::Tensor<ScalarT>(num_dims_);
00128 strainN = Intrepid::Tensor<ScalarT>(num_dims_);
00129 sigmaVal = Intrepid::Tensor<ScalarT>(num_dims_);
00130 alphaVal = Intrepid::Tensor<ScalarT>(num_dims_);
00131 deps_plastic = Intrepid::Tensor<ScalarT>(num_dims_);
00132 sigmaTr = Intrepid::Tensor<ScalarT>(num_dims_);
00133 alphaTr = Intrepid::Tensor<ScalarT>(num_dims_);
00134 dfdsigma = Intrepid::Tensor<ScalarT>(num_dims_);
00135 dgdsigma = Intrepid::Tensor<ScalarT>(num_dims_);
00136 dfdalpha = Intrepid::Tensor<ScalarT>(num_dims_);
00137 halpha = Intrepid::Tensor<ScalarT>(num_dims_);
00138 dfdotCe = Intrepid::Tensor<ScalarT>(num_dims_);
00139 sigmaK = Intrepid::Tensor<ScalarT>(num_dims_);
00140 alphaK = Intrepid::Tensor<ScalarT>(num_dims_);
00141 dsigma = Intrepid::Tensor<ScalarT>(num_dims_);
00142 dev_plastic = Intrepid::Tensor<ScalarT>(num_dims_);
00143 xi = Intrepid::Tensor<ScalarT>(num_dims_);
00144 sN = Intrepid::Tensor<ScalarT>(num_dims_);
00145 s = Intrepid::Tensor<ScalarT>(num_dims_);
00146 strainCurrent = Intrepid::Tensor<ScalarT>(num_dims_);
00147 dJ3dsigma = Intrepid::Tensor<ScalarT>(num_dims_);
00148 eps_dev = Intrepid::Tensor<ScalarT>(num_dims_);
00149
00150 }
00151
00152 template<typename EvalT, typename Traits>
00153 void CapExplicitModel<EvalT, Traits>::
00154 computeState(typename Traits::EvalData workset,
00155 std::map<std::string, Teuchos::RCP<PHX::MDField<ScalarT> > > dep_fields,
00156 std::map<std::string, Teuchos::RCP<PHX::MDField<ScalarT> > > eval_fields)
00157 {
00158
00159
00160 PHX::MDField<ScalarT> strain = *dep_fields["Strain"];
00161 PHX::MDField<ScalarT> poissons_ratio = *dep_fields["Poissons Ratio"];
00162 PHX::MDField<ScalarT> elastic_modulus = *dep_fields["Elastic Modulus"];
00163
00164
00165 std::string cauchy_string = (*field_name_map_)["Cauchy_Stress"];
00166 std::string strain_string = (*field_name_map_)["Strain"];
00167 std::string backStress_string = (*field_name_map_)["Back_Stress"];
00168 std::string capParameter_string = (*field_name_map_)["Cap_Parameter"];
00169 std::string eqps_string = (*field_name_map_)["eqps"];
00170 std::string volPlasticStrain_string = (*field_name_map_)["volPlastic_Strain"];
00171
00172
00173 PHX::MDField<ScalarT> stress = *eval_fields[cauchy_string];
00174 PHX::MDField<ScalarT> backStress = *eval_fields[backStress_string];
00175 PHX::MDField<ScalarT> capParameter = *eval_fields[capParameter_string];
00176 PHX::MDField<ScalarT> eqps = *eval_fields[eqps_string];
00177 PHX::MDField<ScalarT> volPlasticStrain = *eval_fields[volPlasticStrain_string];
00178 PHX::MDField<ScalarT> tangent = *eval_fields["Material Tangent"];
00179
00180
00181 Albany::MDArray strainold = (*workset.stateArrayPtr)[strain_string + "_old"];
00182 Albany::MDArray stressold = (*workset.stateArrayPtr)[cauchy_string + "_old"];
00183 Albany::MDArray backStressold = (*workset.stateArrayPtr)[backStress_string
00184 + "_old"];
00185 Albany::MDArray capParameterold = (*workset.stateArrayPtr)[capParameter_string
00186 + "_old"];
00187 Albany::MDArray eqpsold = (*workset.stateArrayPtr)[eqps_string + "_old"];
00188 Albany::MDArray volPlasticStrainold =
00189 (*workset.stateArrayPtr)[volPlasticStrain_string + "_old"];
00190
00191 ScalarT lame, mu, bulkModulus;
00192 for (std::size_t cell = 0; cell < workset.numCells; ++cell) {
00193 for (std::size_t qp = 0; qp < num_pts_; ++qp) {
00194
00195 lame = elastic_modulus(cell, qp) * poissons_ratio(cell, qp)
00196 / (1.0 + poissons_ratio(cell, qp))
00197 / (1.0 - 2.0 * poissons_ratio(cell, qp));
00198 mu = elastic_modulus(cell, qp) / 2.0
00199 / (1.0 + poissons_ratio(cell, qp));
00200 bulkModulus = lame + (2. / 3.) * mu;
00201
00202
00203 Celastic = lame * id3 + mu * (id1 + id2);
00204
00205
00206 compliance = (1. / bulkModulus / 9.) * id3
00207 + (1. / mu / 2.) * (0.5 * (id1 + id2) - (1. / 3.) * id3);
00208
00209
00210 Intrepid::Tensor<ScalarT> depsilon(3);
00211 for (std::size_t i = 0; i < num_dims_; ++i) {
00212 for (std::size_t j = 0; j < num_dims_; ++j) {
00213 depsilon(i, j) = strain(cell, qp, i, j) - strainold(cell, qp, i, j);
00214 strainN(i, j) = strainold(cell, qp, i, j);
00215 sigmaN(i, j) = stressold(cell, qp, i, j);
00216 alphaVal(i, j) = backStressold(cell, qp, i, j);
00217 }
00218 }
00219
00220 sigmaVal = sigmaN + Intrepid::dotdot(Celastic, depsilon);
00221 ScalarT kappaVal = capParameterold(cell, qp);
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233 ScalarT deqps(0.0), devolps(0.0);
00234
00235
00236 sigmaTr = sigmaVal;
00237
00238 alphaTr = alphaVal;
00239
00240
00241 ScalarT f = compute_f(sigmaVal, alphaVal, kappaVal);
00242
00243
00244 ScalarT dgamma = 0.0;
00245 if (f > 0.0) {
00246 dfdsigma = compute_dfdsigma(sigmaN, alphaVal, kappaVal);
00247
00248 dgdsigma = compute_dgdsigma(sigmaN, alphaVal, kappaVal);
00249
00250 dfdalpha = -dfdsigma;
00251
00252 ScalarT dfdkappa = compute_dfdkappa(sigmaN, alphaVal, kappaVal);
00253
00254 ScalarT J2_alpha = 0.5 * Intrepid::dotdot(alphaVal, alphaVal);
00255
00256 halpha = compute_halpha(dgdsigma, J2_alpha);
00257
00258 ScalarT I1_dgdsigma = Intrepid::trace(dgdsigma);
00259
00260 ScalarT dedkappa = compute_dedkappa(kappaVal);
00261
00262 ScalarT hkappa;
00263 if (dedkappa != 0.0)
00264 hkappa = I1_dgdsigma / dedkappa;
00265 else
00266 hkappa = 0.0;
00267
00268 ScalarT kai(0.0);
00269 kai = Intrepid::dotdot(dfdsigma, Intrepid::dotdot(Celastic, dgdsigma))
00270 - Intrepid::dotdot(dfdalpha, halpha) - dfdkappa * hkappa;
00271
00272
00273
00274 dfdotCe = Intrepid::dotdot(dfdsigma, Celastic);
00275
00276 if (kai != 0.0)
00277 dgamma = Intrepid::dotdot(dfdotCe, depsilon) / kai;
00278 else
00279 dgamma = 0.0;
00280
00281
00282 sigmaVal -= dgamma * Intrepid::dotdot(Celastic, dgdsigma);
00283
00284 alphaVal += dgamma * halpha;
00285
00286
00287 ScalarT dkappa = dgamma * hkappa;
00288 if (dkappa > 0) {
00289 dkappa = 0;
00290
00291 }
00292
00293 kappaVal += dkappa;
00294
00295
00296 bool condition = false;
00297 int iteration = 0;
00298 int max_iteration = 20;
00299 RealType tolerance = 1.0e-10;
00300 while (condition == false) {
00301 f = compute_f(sigmaVal, alphaVal, kappaVal);
00302
00303 dfdsigma = compute_dfdsigma(sigmaVal, alphaVal, kappaVal);
00304
00305 dgdsigma = compute_dgdsigma(sigmaVal, alphaVal, kappaVal);
00306
00307 dfdalpha = -dfdsigma;
00308
00309 ScalarT dfdkappa = compute_dfdkappa(sigmaVal, alphaVal, kappaVal);
00310
00311 J2_alpha = 0.5 * Intrepid::dotdot(alphaVal, alphaVal);
00312
00313 halpha = compute_halpha(dgdsigma, J2_alpha);
00314
00315 I1_dgdsigma = Intrepid::trace(dgdsigma);
00316
00317 dedkappa = compute_dedkappa(kappaVal);
00318
00319 if (dedkappa != 0)
00320 hkappa = I1_dgdsigma / dedkappa;
00321 else
00322 hkappa = 0;
00323
00324
00325
00326
00327 kai = Intrepid::dotdot(dfdsigma,
00328 Intrepid::dotdot(Celastic, dgdsigma));
00329 kai = kai - Intrepid::dotdot(dfdalpha, halpha) - dfdkappa * hkappa;
00330
00331 if (std::abs(f) < tolerance)
00332 break;
00333 if (iteration > max_iteration) {
00334
00335
00336
00337
00338 break;
00339 }
00340
00341 ScalarT delta_gamma;
00342 if (kai != 0)
00343 delta_gamma = f / kai;
00344 else
00345 delta_gamma = 0;
00346
00347
00348 dkappa = delta_gamma * hkappa;
00349 if (dkappa > 0.0) {
00350 dkappa = 0.0;
00351
00352 }
00353
00354
00355 sigmaK = sigmaVal
00356 - delta_gamma * Intrepid::dotdot(Celastic, dgdsigma);
00357 alphaK = alphaVal + delta_gamma * halpha;
00358 ScalarT kappaK = kappaVal + dkappa;
00359
00360 ScalarT fK = compute_f(sigmaK, alphaK, kappaK);
00361
00362 if (std::abs(fK) > std::abs(f)) {
00363
00364
00365 ScalarT dfdotdf = Intrepid::dotdot(dfdsigma, dfdsigma);
00366 if (dfdotdf != 0)
00367 delta_gamma = f / dfdotdf;
00368 else
00369 delta_gamma = 0.0;
00370
00371 sigmaK = sigmaVal - delta_gamma * dfdsigma;
00372 alphaK = alphaVal;
00373 kappaK = kappaVal;
00374
00375
00376 }
00377
00378 sigmaVal = sigmaK;
00379 alphaVal = alphaK;
00380 kappaVal = kappaK;
00381
00382 iteration++;
00383
00384 }
00385
00386
00387
00388 dsigma = sigmaTr - sigmaVal;
00389 deps_plastic = Intrepid::dotdot(compliance, dsigma);
00390
00391
00392
00393 devolps = Intrepid::trace(deps_plastic);
00394 dev_plastic = deps_plastic - (1. / 3.) * devolps * I;
00395
00396 deqps = std::sqrt(2) * Intrepid::norm(dev_plastic);
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454 }
00455
00456
00457 for (std::size_t i = 0; i < num_dims_; ++i) {
00458 for (std::size_t j = 0; j < num_dims_; ++j) {
00459 stress(cell, qp, i, j) = sigmaVal(i, j);
00460 backStress(cell, qp, i, j) = alphaVal(i, j);
00461 }
00462 }
00463
00464 capParameter(cell, qp) = kappaVal;
00465 eqps(cell, qp) = eqpsold(cell, qp) + deqps;
00466 volPlasticStrain(cell, qp) = volPlasticStrainold(cell, qp) + devolps;
00467
00468 }
00469
00470 }
00471
00472 }
00473
00474
00475 template<typename EvalT, typename Traits>
00476 typename CapExplicitModel<EvalT, Traits>::ScalarT
00477
00478 CapExplicitModel<EvalT, Traits>::compute_f(
00479 Intrepid::Tensor<ScalarT> & sigma, Intrepid::Tensor<ScalarT> & alpha,
00480 ScalarT & kappa)
00481 {
00482
00483 xi = sigma - alpha;
00484
00485 ScalarT I1 = Intrepid::trace(xi), p = I1 / 3;
00486
00487 s = xi - p * Intrepid::identity<ScalarT>(3);
00488
00489 ScalarT J2 = 0.5 * Intrepid::dotdot(s, s);
00490
00491 ScalarT J3 = Intrepid::det(s);
00492
00493 ScalarT Gamma = 1.0;
00494 if (psi != 0 && J2 != 0)
00495 Gamma = 0.5
00496 * (1 - 3.0 * std::sqrt(3.0) * J3 / 2 / std::pow(J2, 1.5)
00497 + (1 + 3.0 * std::sqrt(3.0) * J3 / 2 / std::pow(J2, 1.5)) / psi);
00498
00499 ScalarT Ff_I1 = A - C * std::exp(B * I1) - theta * I1;
00500
00501 ScalarT Ff_kappa = A - C * std::exp(B * kappa) - theta * kappa;
00502
00503 ScalarT X = kappa - R * Ff_kappa;
00504
00505 ScalarT Fc = 1.0;
00506
00507 if ((kappa - I1) > 0 && ((X - kappa) != 0))
00508 Fc = 1.0 - (I1 - kappa) * (I1 - kappa) / (X - kappa) / (X - kappa);
00509
00510 return Gamma * Gamma * J2 - Fc * (Ff_I1 - N) * (Ff_I1 - N);
00511 }
00512
00513 template<typename EvalT, typename Traits>
00514 Intrepid::Tensor<typename CapExplicitModel<EvalT, Traits>::ScalarT>
00515 CapExplicitModel<EvalT, Traits>::compute_dfdsigma(
00516 Intrepid::Tensor<ScalarT> & sigma,
00517 Intrepid::Tensor<ScalarT> & alpha, ScalarT & kappa)
00518 {
00519
00520 xi = sigma - alpha;
00521
00522 ScalarT I1 = Intrepid::trace(xi), p = I1 / 3;
00523
00524 s = xi - p * Intrepid::identity<ScalarT>(3);
00525
00526 ScalarT J2 = 0.5 * Intrepid::dotdot(s, s);
00527
00528 ScalarT J3 = Intrepid::det(s);
00529
00530
00531
00532 for (int i = 0; i < 3; i++)
00533 for (int j = 0; j < 3; j++)
00534 dJ3dsigma(i, j) = s(i, j) * s(i, j) - 2 * J2 * I(i, j) / 3;
00535
00536 ScalarT Ff_I1 = A - C * std::exp(B * I1) - theta * I1;
00537
00538 ScalarT Ff_kappa = A - C * std::exp(B * kappa) - theta * kappa;
00539
00540 ScalarT X = kappa - R * Ff_kappa;
00541
00542 ScalarT Fc = 1.0;
00543
00544 if ((kappa - I1) > 0)
00545 Fc = 1.0 - (I1 - kappa) * (I1 - kappa) / (X - kappa) / (X - kappa);
00546
00547 ScalarT Gamma = 1.0;
00548 if (psi != 0 && J2 != 0)
00549 Gamma = 0.5
00550 * (1 - 3.0 * std::sqrt(3.0) * J3 / 2 / std::pow(J2, 1.5)
00551 + (1 + 3.0 * std::sqrt(3.0) * J3 / 2 / std::pow(J2, 1.5)) / psi);
00552
00553
00554 ScalarT dFfdI1 = -(B * C * std::exp(B * I1) + theta);
00555
00556 ScalarT dFcdI1 = 0.0;
00557 if ((kappa - I1) > 0 && ((X - kappa) != 0))
00558 dFcdI1 = -2.0 * (I1 - kappa) / (X - kappa) / (X - kappa);
00559
00560 ScalarT dfdI1 = -(Ff_I1 - N) * (2 * Fc * dFfdI1 + (Ff_I1 - N) * dFcdI1);
00561
00562 ScalarT dGammadJ2 = 0.0;
00563 if (J2 != 0)
00564 dGammadJ2 = 9.0 * std::sqrt(3.0) * J3 / std::pow(J2, 2.5) / 8.0
00565 * (1.0 - 1.0 / psi);
00566
00567 ScalarT dfdJ2 = 2.0 * Gamma * dGammadJ2 * J2 + Gamma * Gamma;
00568
00569 ScalarT dGammadJ3 = 0.0;
00570 if (J2 != 0)
00571 dGammadJ3 = -3.0 * std::sqrt(3.0) / std::pow(J2, 1.5) / 4.0
00572 * (1.0 - 1.0 / psi);
00573
00574 ScalarT dfdJ3 = 2.0 * Gamma * dGammadJ3 * J2;
00575
00576 dfdsigma = dfdI1 * I + dfdJ2 * s + dfdJ3 * dJ3dsigma;
00577
00578 return dfdsigma;
00579 }
00580
00581 template<typename EvalT, typename Traits>
00582 Intrepid::Tensor<typename CapExplicitModel<EvalT, Traits>::ScalarT>
00583 CapExplicitModel<EvalT, Traits>::compute_dgdsigma(
00584 Intrepid::Tensor<ScalarT> & sigma,
00585 Intrepid::Tensor<ScalarT> & alpha, ScalarT & kappa)
00586 {
00587
00588 xi = sigma - alpha;
00589
00590 ScalarT I1 = Intrepid::trace(xi), p = I1 / 3;
00591
00592 s = xi - p * Intrepid::identity<ScalarT>(3);
00593
00594 ScalarT J2 = 0.5 * Intrepid::dotdot(s, s);
00595
00596 ScalarT J3 = Intrepid::det(s);
00597
00598
00599
00600 for (int i = 0; i < 3; i++)
00601 for (int j = 0; j < 3; j++)
00602 dJ3dsigma(i, j) = s(i, j) * s(i, j) - 2 * J2 * I(i, j) / 3;
00603
00604 ScalarT Ff_I1 = A - C * std::exp(L * I1) - phi * I1;
00605
00606 ScalarT Ff_kappa = A - C * std::exp(L * kappa) - phi * kappa;
00607
00608 ScalarT X = kappa - Q * Ff_kappa;
00609
00610 ScalarT Fc = 1.0;
00611
00612 if ((kappa - I1) > 0)
00613 Fc = 1.0 - (I1 - kappa) * (I1 - kappa) / (X - kappa) / (X - kappa);
00614
00615 ScalarT Gamma = 1.0;
00616 if (psi != 0 && J2 != 0)
00617 Gamma = 0.5
00618 * (1 - 3.0 * std::sqrt(3.0) * J3 / 2 / std::pow(J2, 1.5)
00619 + (1 + 3.0 * std::sqrt(3.0) * J3 / 2 / std::pow(J2, 1.5)) / psi);
00620
00621
00622 ScalarT dFfdI1 = -(L * C * std::exp(L * I1) + phi);
00623
00624 ScalarT dFcdI1 = 0.0;
00625 if ((kappa - I1) > 0 && ((X - kappa) != 0))
00626 dFcdI1 = -2.0 * (I1 - kappa) / (X - kappa) / (X - kappa);
00627
00628 ScalarT dfdI1 = -(Ff_I1 - N) * (2 * Fc * dFfdI1 + (Ff_I1 - N) * dFcdI1);
00629
00630 ScalarT dGammadJ2 = 0.0;
00631 if (J2 != 0)
00632 dGammadJ2 = 9.0 * std::sqrt(3.0) * J3 / std::pow(J2, 2.5) / 8.0
00633 * (1.0 - 1.0 / psi);
00634
00635 ScalarT dfdJ2 = 2.0 * Gamma * dGammadJ2 * J2 + Gamma * Gamma;
00636
00637 ScalarT dGammadJ3 = 0.0;
00638 if (J2 != 0)
00639 dGammadJ3 = -3.0 * std::sqrt(3.0) / std::pow(J2, 1.5) / 4.0
00640 * (1.0 - 1.0 / psi);
00641
00642 ScalarT dfdJ3 = 2.0 * Gamma * dGammadJ3 * J2;
00643
00644 dgdsigma = dfdI1 * I + dfdJ2 * s + dfdJ3 * dJ3dsigma;
00645
00646 return dgdsigma;
00647 }
00648
00649 template<typename EvalT, typename Traits>
00650 typename CapExplicitModel<EvalT, Traits>::ScalarT
00651 CapExplicitModel<EvalT, Traits>::compute_dfdkappa(
00652 Intrepid::Tensor<ScalarT> & sigma, Intrepid::Tensor<ScalarT> & alpha,
00653 ScalarT & kappa)
00654 {
00655 ScalarT dfdkappa;
00656
00657 xi = sigma - alpha;
00658
00659 ScalarT I1 = Intrepid::trace(xi), p = I1 / 3.0;
00660
00661 s = xi - p * Intrepid::identity<ScalarT>(3);
00662
00663 ScalarT J2 = 0.5 * Intrepid::dotdot(s, s);
00664
00665 ScalarT J3 = Intrepid::det(s);
00666
00667 ScalarT Ff_I1 = A - C * std::exp(B * I1) - theta * I1;
00668
00669 ScalarT Ff_kappa = A - C * std::exp(B * kappa) - theta * kappa;
00670
00671 ScalarT X = kappa - R * Ff_kappa;
00672
00673 ScalarT dFcdkappa = 0.0;
00674
00675 if ((kappa - I1) > 0 && ((X - kappa) != 0)) {
00676 dFcdkappa = 2 * (I1 - kappa)
00677 * ((X - kappa)
00678 + R * (I1 - kappa) * (theta + B * C * std::exp(B * kappa)))
00679 / (X - kappa) / (X - kappa) / (X - kappa);
00680 }
00681
00682 dfdkappa = -dFcdkappa * (Ff_I1 - N) * (Ff_I1 - N);
00683
00684 return dfdkappa;
00685 }
00686
00687 template<typename EvalT, typename Traits>
00688 typename CapExplicitModel<EvalT, Traits>::ScalarT CapExplicitModel<EvalT, Traits>::compute_Galpha(
00689 ScalarT & J2_alpha)
00690 {
00691 if (N != 0)
00692 return 1.0 - std::pow(J2_alpha, 0.5) / N;
00693 else
00694 return 0.0;
00695 }
00696
00697 template<typename EvalT, typename Traits>
00698 Intrepid::Tensor<typename CapExplicitModel<EvalT, Traits>::ScalarT>
00699 CapExplicitModel<EvalT, Traits>::compute_halpha(
00700 Intrepid::Tensor<ScalarT> & dgdsigma,
00701 ScalarT & J2_alpha)
00702 {
00703
00704 ScalarT Galpha = compute_Galpha(J2_alpha);
00705
00706 ScalarT I1 = Intrepid::trace(dgdsigma), p = I1 / 3;
00707
00708 s = dgdsigma - p * I;
00709
00710 for (int i = 0; i < 3; i++) {
00711 for (int j = 0; j < 3; j++) {
00712 halpha(i, j) = calpha * Galpha * s(i, j);
00713 }
00714 }
00715
00716 return halpha;
00717 }
00718
00719 template<typename EvalT, typename Traits>
00720 typename CapExplicitModel<EvalT, Traits>::ScalarT
00721 CapExplicitModel<EvalT, Traits>::compute_dedkappa(
00722 ScalarT & kappa)
00723 {
00724 ScalarT Ff_kappa0 = A - C * std::exp(L * kappa0) - phi * kappa0;
00725
00726 ScalarT X0 = kappa0 - Q * Ff_kappa0;
00727
00728 ScalarT Ff_kappa = A - C * std::exp(L * kappa) - phi * kappa;
00729
00730 ScalarT X = kappa - Q * Ff_kappa;
00731
00732 ScalarT dedX = (D1 - 2 * D2 * (X - X0))
00733 * std::exp((D1 - D2 * (X - X0)) * (X - X0)) * W;
00734
00735 ScalarT dXdkappa = 1 + Q * C * L * std::exp(L * kappa) + Q * phi;
00736
00737 return dedX * dXdkappa;
00738 }
00739
00740 }