00001
00002
00003
00004
00005
00006
00007 #ifndef MECHANICSPROBLEM_HPP
00008 #define MECHANICSPROBLEM_HPP
00009
00010 #include "Teuchos_RCP.hpp"
00011 #include "Teuchos_ParameterList.hpp"
00012
00013 #include "Albany_AbstractProblem.hpp"
00014
00015 #include "Phalanx.hpp"
00016 #include "PHAL_Workset.hpp"
00017 #include "PHAL_Dimension.hpp"
00018 #include "PHAL_AlbanyTraits.hpp"
00019
00020 namespace Albany
00021 {
00022
00023
00027 class MechanicsProblem: public Albany::AbstractProblem
00028 {
00029 public:
00030
00031 typedef Intrepid::FieldContainer<RealType> FC;
00032
00036 MechanicsProblem(const Teuchos::RCP<Teuchos::ParameterList>& params,
00037 const Teuchos::RCP<ParamLib>& param_lib,
00038 const int num_dims,
00039 const Teuchos::RCP<const Epetra_Comm>& comm);
00043 virtual
00044 ~MechanicsProblem();
00045
00047 Teuchos::RCP<std::map<std::string, std::string> >
00048 constructFieldNameMap(bool surface_flag);
00049
00053 virtual
00054 int
00055 spatialDimension() const
00056 {
00057 return num_dims_;
00058 }
00059
00063 virtual
00064 void
00065 buildProblem(Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> >
00066 meshSpecs,
00067 StateManager& stateMgr);
00068
00072 virtual Teuchos::Array<Teuchos::RCP<const PHX::FieldTag> >
00073 buildEvaluators(PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00074 const Albany::MeshSpecsStruct& meshSpecs,
00075 Albany::StateManager& stateMgr,
00076 Albany::FieldManagerChoice fmchoice,
00077 const Teuchos::RCP<Teuchos::ParameterList>& responseList);
00078
00082 Teuchos::RCP<const Teuchos::ParameterList>
00083 getValidProblemParameters() const;
00084
00088 void
00089 getAllocatedStates(Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<FC> > >
00090 old_state,
00091 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<FC> > >
00092 new_state) const;
00093
00094
00095 private:
00096
00100 MechanicsProblem(const MechanicsProblem&);
00101
00105 MechanicsProblem& operator=(const MechanicsProblem&);
00106
00107
00108 public:
00109
00114 template<typename EvalT>
00115 Teuchos::RCP<const PHX::FieldTag>
00116 constructEvaluators(PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00117 const Albany::MeshSpecsStruct& meshSpecs,
00118 Albany::StateManager& stateMgr,
00119 Albany::FieldManagerChoice fmchoice,
00120 const Teuchos::RCP<Teuchos::ParameterList>&
00121 responseList);
00122
00126 void
00127 constructDirichletEvaluators(const Albany::MeshSpecsStruct& meshSpecs);
00128
00132 void
00133 constructNeumannEvaluators(
00134 const Teuchos::RCP<Albany::MeshSpecsStruct>& meshSpecs);
00135
00136
00137 protected:
00138
00142 enum MECH_VAR_TYPE
00143 {
00144 MECH_VAR_TYPE_NONE,
00145 MECH_VAR_TYPE_CONSTANT,
00146 MECH_VAR_TYPE_DOF
00147 };
00148
00152 void getVariableType(Teuchos::ParameterList& param_list,
00153 const std::string& default_type,
00154 MECH_VAR_TYPE& variable_type,
00155 bool& have_variable,
00156 bool& have_equation);
00157
00161 std::string variableTypeToString(const MECH_VAR_TYPE variable_type);
00162
00166
00167
00171 bool have_source_;
00172
00176 int num_dims_;
00177
00181 int num_pts_;
00182
00186 int num_nodes_;
00187
00191 int num_vertices_;
00192
00196 MECH_VAR_TYPE mech_type_;
00197
00201 MECH_VAR_TYPE temperature_type_;
00202
00206 MECH_VAR_TYPE pressure_type_;
00207
00211 MECH_VAR_TYPE transport_type_;
00212
00216 MECH_VAR_TYPE hydrostress_type_;
00217
00221 MECH_VAR_TYPE damage_type_;
00222
00226 bool have_mech_;
00227
00231 bool have_temperature_;
00232
00236 bool have_pressure_;
00237
00241 bool have_transport_;
00242
00246 bool have_hydrostress_;
00247
00251 bool have_damage_;
00252
00256 bool have_mech_eq_;
00257
00261 bool have_temperature_eq_;
00262
00266 bool have_pressure_eq_;
00267
00271 bool have_transport_eq_;
00272
00277 bool have_hydrostress_eq_;
00278
00282 bool have_damage_eq_;
00283
00287 bool have_peridynamics_;
00288
00292 Teuchos::RCP<Albany::Layouts> dl_;
00293
00297 Teuchos::RCP<QCAD::MaterialDatabase> material_db_;
00298
00302 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<FC> > > old_state_;
00303
00307 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<FC> > > new_state_;
00308
00309 };
00310
00311 }
00312
00313 #include "Albany_Utils.hpp"
00314 #include "Albany_ProblemUtils.hpp"
00315 #include "Albany_ResponseUtilities.hpp"
00316 #include "Albany_EvaluatorUtils.hpp"
00317
00318 #include "PHAL_NSMaterialProperty.hpp"
00319 #include "PHAL_Source.hpp"
00320 #include "PHAL_SaveStateField.hpp"
00321
00322 #include "FieldNameMap.hpp"
00323
00324 #include "MechanicsResidual.hpp"
00325 #include "Time.hpp"
00326 #include "SurfaceBasis.hpp"
00327 #include "SurfaceVectorJump.hpp"
00328 #include "SurfaceVectorGradient.hpp"
00329 #include "SurfaceScalarJump.hpp"
00330 #include "SurfaceScalarGradientOperator.hpp"
00331 #include "SurfaceVectorResidual.hpp"
00332 #include "CurrentCoords.hpp"
00333 #include "TvergaardHutchinson.hpp"
00334
00335
00336
00337 #include "Kinematics.hpp"
00338 #include "ConstitutiveModelInterface.hpp"
00339 #include "ConstitutiveModelParameters.hpp"
00340 #include "FirstPK.hpp"
00341
00342
00343 #include "TransportResidual.hpp"
00344
00345
00346 #include "ThermoMechanicalCoefficients.hpp"
00347
00348
00349 #include "GradientElementLength.hpp"
00350 #include "BiotCoefficient.hpp"
00351 #include "BiotModulus.hpp"
00352 #include "KCPermeability.hpp"
00353 #include "Porosity.hpp"
00354 #include "TLPoroPlasticityResidMass.hpp"
00355 #include "TLPoroStress.hpp"
00356 #include "SurfaceTLPoroMassResidual.hpp"
00357
00358
00359 #include "ThermoPoroPlasticityResidMass.hpp"
00360 #include "ThermoPoroPlasticityResidEnergy.hpp"
00361 #include "MixtureThermalExpansion.hpp"
00362 #include "MixtureSpecificHeat.hpp"
00363
00364
00365 #include "ScalarL2ProjectionResidual.hpp"
00366 #include "SurfaceL2ProjectionResidual.hpp"
00367 #include "HDiffusionDeformationMatterResidual.hpp"
00368 #include "SurfaceHDiffusionDefResidual.hpp"
00369 #include "LatticeDefGrad.hpp"
00370 #include "TransportCoefficients.hpp"
00371
00372
00373 #include "DamageCoefficients.hpp"
00374
00375
00376 template<typename EvalT>
00377 Teuchos::RCP<const PHX::FieldTag>
00378 Albany::MechanicsProblem::
00379 constructEvaluators(PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00380 const Albany::MeshSpecsStruct& meshSpecs,
00381 Albany::StateManager& stateMgr,
00382 Albany::FieldManagerChoice fieldManagerChoice,
00383 const Teuchos::RCP<Teuchos::ParameterList>& responseList)
00384 {
00385 using Teuchos::RCP;
00386 using Teuchos::rcp;
00387 using Teuchos::ParameterList;
00388 using PHX::DataLayout;
00389 using PHX::MDALayout;
00390 using std::vector;
00391 using PHAL::AlbanyTraits;
00392 using shards::CellTopology;
00393 using shards::getCellTopologyData;
00394
00395
00396
00397 RCP<ParameterList> pFromProb = rcp(new ParameterList("Response Parameters from Problem"));
00398
00399
00400 std::string eb_name = meshSpecs.ebName;
00401
00402
00403 std::string materialModelName =
00404 material_db_->
00405 getElementBlockSublist(eb_name, "Material Model").get<std::string>(
00406 "Model Name");
00407 TEUCHOS_TEST_FOR_EXCEPTION(materialModelName.length() == 0, std::logic_error,
00408 "A material model must be defined for block: "
00409 + eb_name);
00410
00411 #ifdef ALBANY_VERBOSE
00412 *out << "In MechanicsProblem::constructEvaluators" << std::endl;
00413 *out << "element block name: " << eb_name << std::endl;
00414 *out << "material model name: " << materialModelName << std::endl;
00415 #endif
00416
00417
00418 RCP<CellTopology> comp_cellType =
00419 rcp(new CellTopology(getCellTopologyData<shards::Tetrahedron<11> >()));
00420 RCP<shards::CellTopology> cellType =
00421 rcp(new CellTopology(&meshSpecs.ctd));
00422
00423
00424 bool volume_average_j(false);
00425 bool volume_average_pressure(false);
00426 RealType volume_average_stabilization_param(0.0);
00427 if (material_db_->isElementBlockParam(eb_name, "Weighted Volume Average J"))
00428 volume_average_j = material_db_->getElementBlockParam<bool>(eb_name,"Weighted Volume Average J");
00429 if (material_db_->isElementBlockParam(eb_name, "Volume Average Pressure"))
00430 volume_average_pressure = material_db_->getElementBlockParam<bool>(eb_name,"Volume Average Pressure");
00431 if (material_db_->isElementBlockParam(eb_name, "Average J Stabilization Parameter"))
00432 volume_average_stabilization_param = material_db_->getElementBlockParam<RealType>(eb_name,"Average J Stabilization Parameter");
00433
00434
00435 bool composite = false;
00436 if (material_db_->isElementBlockParam(eb_name, "Use Composite Tet 10"))
00437 composite =
00438 material_db_->getElementBlockParam<bool>(eb_name,
00439 "Use Composite Tet 10");
00440
00441
00442 bool small_strain(false);
00443 if ( materialModelName == "Linear Elastic" ) {
00444 small_strain = true;
00445 }
00446
00447 if (material_db_->isElementBlockParam(eb_name, "Strain Flag")) {
00448 small_strain = true;
00449 }
00450
00451
00452 bool surface_element = false;
00453 bool cohesive_element = false;
00454 bool compute_membrane_forces = false;
00455 RealType thickness = 0.0;
00456 if (material_db_->isElementBlockParam(eb_name, "Surface Element")) {
00457 surface_element =
00458 material_db_->getElementBlockParam<bool>(eb_name, "Surface Element");
00459 if (material_db_->isElementBlockParam(eb_name, "Cohesive Element"))
00460 cohesive_element =
00461 material_db_->getElementBlockParam<bool>(eb_name,
00462 "Cohesive Element");
00463 }
00464
00465 if (surface_element) {
00466 if (material_db_->
00467 isElementBlockParam(eb_name, "Localization thickness parameter")) {
00468 thickness =
00469 material_db_->
00470 getElementBlockParam<RealType>(eb_name,
00471 "Localization thickness parameter");
00472 } else {
00473 thickness = 0.1;
00474 }
00475 }
00476
00477 if (material_db_->isElementBlockParam(eb_name, "Compute Membrane Forces")) {
00478 compute_membrane_forces = material_db_->getElementBlockParam<bool>(eb_name,
00479 "Compute Membrane Forces");
00480 }
00481
00482 std::string msg =
00483 "Surface elements are not yet supported with the composite tet";
00484
00485 TEUCHOS_TEST_FOR_EXCEPTION(composite && surface_element,
00486 std::logic_error,
00487 msg);
00488
00489
00490 RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > >
00491 intrepidBasis = Albany::getIntrepidBasis(meshSpecs.ctd, composite);
00492
00493 if (composite &&
00494 meshSpecs.ctd.dimension == 3 &&
00495 meshSpecs.ctd.node_count == 10) cellType = comp_cellType;
00496
00497 Intrepid::DefaultCubatureFactory<RealType> cubFactory;
00498 RCP<Intrepid::Cubature<RealType> > cubature =
00499 cubFactory.create(*cellType, meshSpecs.cubatureDegree);
00500
00501
00502
00503 RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > >
00504 surfaceBasis;
00505 RCP<shards::CellTopology> surfaceTopology;
00506 RCP<Intrepid::Cubature<RealType> > surfaceCubature;
00507 if (surface_element)
00508 {
00509 #ifdef ALBANY_VERBOSE
00510 *out << "In Surface Element Logic" << std::endl;
00511 #endif
00512
00513 std::string name = meshSpecs.ctd.name;
00514 if (name == "Triangle_3" || name == "Quadrilateral_4") {
00515 surfaceBasis =
00516 rcp(
00517 new Intrepid::Basis_HGRAD_LINE_C1_FEM<RealType,
00518 Intrepid::FieldContainer<RealType> >());
00519 surfaceTopology =
00520 rcp(
00521 new shards::CellTopology(
00522 shards::getCellTopologyData<shards::Line<2> >()));
00523 surfaceCubature =
00524 cubFactory.create(*surfaceTopology, meshSpecs.cubatureDegree);
00525 }
00526 else if (name == "Wedge_6") {
00527 surfaceBasis =
00528 rcp(
00529 new Intrepid::Basis_HGRAD_TRI_C1_FEM<RealType,
00530 Intrepid::FieldContainer<RealType> >());
00531 surfaceTopology =
00532 rcp(
00533 new shards::CellTopology(
00534 shards::getCellTopologyData<shards::Triangle<3> >()));
00535 surfaceCubature =
00536 cubFactory.create(*surfaceTopology, meshSpecs.cubatureDegree);
00537 }
00538 else if (name == "Hexahedron_8") {
00539 surfaceBasis =
00540 rcp(
00541 new Intrepid::Basis_HGRAD_QUAD_C1_FEM<RealType,
00542 Intrepid::FieldContainer<RealType> >());
00543 surfaceTopology =
00544 rcp(
00545 new shards::CellTopology(
00546 shards::getCellTopologyData<shards::Quadrilateral<4> >()));
00547 surfaceCubature =
00548 cubFactory.create(*surfaceTopology, meshSpecs.cubatureDegree);
00549 }
00550
00551 #ifdef ALBANY_VERBOSE
00552 *out << "surfaceCubature->getNumPoints(): "
00553 << surfaceCubature->getNumPoints() << std::endl;
00554 *out << "surfaceCubature->getDimension(): "
00555 << surfaceCubature->getDimension() << std::endl;
00556 #endif
00557 }
00558
00559
00560 num_nodes_ = intrepidBasis->getCardinality();
00561 const int workset_size = meshSpecs.worksetSize;
00562
00563 #ifdef ALBANY_VERBOSE
00564 *out << "Setting num_pts_, surface element is "
00565 << surface_element << std::endl;
00566 #endif
00567 num_dims_ = cubature->getDimension();
00568 if (!surface_element) {
00569 num_pts_ = cubature->getNumPoints();
00570 } else {
00571 num_pts_ = surfaceCubature->getNumPoints();
00572 }
00573 num_vertices_ = num_nodes_;
00574
00575 #ifdef ALBANY_VERBOSE
00576 *out << "Field Dimensions: Workset=" << workset_size
00577 << ", Vertices= " << num_vertices_
00578 << ", Nodes= " << num_nodes_
00579 << ", QuadPts= " << num_pts_
00580 << ", Dim= " << num_dims_ << std::endl;
00581 #endif
00582
00583
00584 dl_ =rcp( new Albany::Layouts(workset_size,
00585 num_vertices_,
00586 num_nodes_,
00587 num_pts_,
00588 num_dims_));
00589 msg = "Data Layout Usage in Mechanics problems assume vecDim = num_dims_";
00590 TEUCHOS_TEST_FOR_EXCEPTION(
00591 dl_->vectorAndGradientLayoutsAreEquivalent == false,
00592 std::logic_error,
00593 msg);
00594 Albany::EvaluatorUtils<EvalT, PHAL::AlbanyTraits> evalUtils(dl_);
00595 bool supports_transient = true;
00596 int offset = 0;
00597
00598 RCP<PHX::Evaluator<AlbanyTraits> > ev;
00599
00600
00601
00602 LCM::FieldNameMap field_name_map(surface_element);
00603 RCP<std::map<std::string, std::string> > fnm = field_name_map.getMap();
00604 std::string cauchy = (*fnm)["Cauchy_Stress"];
00605 std::string firstPK = (*fnm)["PK1"];
00606 std::string Fp = (*fnm)["Fp"];
00607 std::string eqps = (*fnm)["eqps"];
00608 std::string temperature = (*fnm)["Temperature"];
00609 std::string mech_source = (*fnm)["Mechanical_Source"];
00610 std::string defgrad = (*fnm)["F"];
00611 std::string J = (*fnm)["J"];
00612
00613 std::string totStress = (*fnm)["Total_Stress"];
00614 std::string kcPerm = (*fnm)["KCPermeability"];
00615 std::string biotModulus = (*fnm)["Biot_Modulus"];
00616 std::string biotCoeff = (*fnm)["Biot_Coefficient"];
00617 std::string porosity = (*fnm)["Porosity"];
00618 std::string porePressure = (*fnm)["Pore_Pressure"];
00619
00620 std::string transport = (*fnm)["Transport"];
00621 std::string hydroStress = (*fnm)["HydroStress"];
00622 std::string diffusionCoefficient = (*fnm)["Diffusion_Coefficient"];
00623 std::string convectionCoefficient = (*fnm)["Tau_Contribution"];
00624 std::string trappedConcentration = (*fnm)["Trapped_Concentration"];
00625 std::string totalConcentration = (*fnm)["Total_Concentration"];
00626 std::string effectiveDiffusivity = (*fnm)["Effective_Diffusivity"];
00627 std::string trappedSolvent = (*fnm)["Trapped_Solvent"];
00628 std::string strainRateFactor = (*fnm)["Strain_Rate_Factor"];
00629 std::string eqilibriumParameter =
00630 (*fnm)["Concentration_Equilibrium_Parameter"];
00631 std::string gradientElementLength = (*fnm)["Gradient_Element_Length"];
00632
00633 if (have_mech_eq_) {
00634 Teuchos::ArrayRCP<std::string> dof_names(1);
00635 Teuchos::ArrayRCP<std::string> dof_names_dot(1);
00636 Teuchos::ArrayRCP<std::string> dof_names_dotdot(1);
00637 Teuchos::ArrayRCP<std::string> resid_names(1);
00638 dof_names[0] = "Displacement";
00639 dof_names_dot[0] = "Velocity";
00640 dof_names_dotdot[0] = "Acceleration";
00641 resid_names[0] = dof_names[0] + " Residual";
00642
00643 if (supports_transient) {
00644 fm0.template registerEvaluator<EvalT>
00645 (evalUtils.constructGatherSolutionEvaluator_withAcceleration(
00646 true,
00647 dof_names,
00648 dof_names_dot,
00649 dof_names_dotdot));
00650 } else {
00651 fm0.template registerEvaluator<EvalT>
00652 (evalUtils.constructGatherSolutionEvaluator_noTransient(true,
00653 dof_names));
00654 }
00655
00656 fm0.template registerEvaluator<EvalT>
00657 (evalUtils.constructGatherCoordinateVectorEvaluator());
00658
00659 if (!surface_element) {
00660 fm0.template registerEvaluator<EvalT>
00661 (evalUtils.constructDOFVecInterpolationEvaluator(dof_names[0]));
00662
00663 fm0.template registerEvaluator<EvalT>
00664 (evalUtils.constructDOFVecInterpolationEvaluator(dof_names_dot[0]));
00665
00666 fm0.template registerEvaluator<EvalT>
00667 (evalUtils.constructDOFVecInterpolationEvaluator(dof_names_dotdot[0]));
00668
00669 fm0.template registerEvaluator<EvalT>
00670 (evalUtils.constructDOFVecGradInterpolationEvaluator(dof_names[0]));
00671
00672 fm0.template registerEvaluator<EvalT>
00673 (evalUtils.constructMapToPhysicalFrameEvaluator(cellType,
00674 cubature));
00675
00676 fm0.template registerEvaluator<EvalT>
00677 (evalUtils.constructComputeBasisFunctionsEvaluator(cellType,
00678 intrepidBasis,
00679 cubature));
00680 }
00681
00682 fm0.template registerEvaluator<EvalT>
00683 (evalUtils.constructScatterResidualEvaluator(true,
00684 resid_names));
00685 offset += num_dims_;
00686 }
00687 else if (have_mech_) {
00688 RCP<ParameterList> p = rcp(new ParameterList);
00689
00690 p->set<std::string>("Material Property Name", "Displacement");
00691 p->set<RCP<DataLayout> >("Data Layout", dl_->qp_vector);
00692 p->set<std::string>("Coordinate Vector Name", "Coord Vec");
00693 p->set<RCP<DataLayout> >("Coordinate Vector Data Layout", dl_->qp_vector);
00694
00695 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
00696 Teuchos::ParameterList& paramList = params->sublist("Displacement");
00697 p->set<Teuchos::ParameterList*>("Parameter List", ¶mList);
00698
00699 ev = rcp(new PHAL::NSMaterialProperty<EvalT, AlbanyTraits>(*p));
00700 fm0.template registerEvaluator<EvalT>(ev);
00701
00702 }
00703
00704
00705
00706 if (supports_transient) {
00707
00708
00709
00710 pFromProb->set<std::string>("x Field Name", "xField");
00711
00712
00713 pFromProb->set<std::string>("xdot Field Name", "Velocity");
00714
00715
00716 pFromProb->set<std::string>("xdotdot Field Name", "Acceleration");
00717
00718 }
00719
00720 if (have_temperature_eq_) {
00721 Teuchos::ArrayRCP<std::string> dof_names(1);
00722 Teuchos::ArrayRCP<std::string> resid_names(1);
00723 dof_names[0] = "Temperature";
00724 resid_names[0] = dof_names[0] + " Residual";
00725 fm0.template registerEvaluator<EvalT>
00726 (evalUtils.constructGatherSolutionEvaluator_noTransient(false,
00727 dof_names,
00728 offset));
00729
00730 fm0.template registerEvaluator<EvalT>
00731 (evalUtils.constructGatherCoordinateVectorEvaluator());
00732
00733 if (!surface_element) {
00734 fm0.template registerEvaluator<EvalT>
00735 (evalUtils.constructDOFInterpolationEvaluator(dof_names[0], offset));
00736
00737 fm0.template registerEvaluator<EvalT>
00738 (evalUtils.constructDOFGradInterpolationEvaluator(dof_names[0], offset));
00739
00740 fm0.template registerEvaluator<EvalT>
00741 (evalUtils.constructMapToPhysicalFrameEvaluator(cellType,
00742 cubature));
00743
00744 fm0.template registerEvaluator<EvalT>
00745 (evalUtils.constructComputeBasisFunctionsEvaluator(cellType,
00746 intrepidBasis,
00747 cubature));
00748 }
00749
00750 fm0.template registerEvaluator<EvalT>
00751 (evalUtils.constructScatterResidualEvaluator(false,
00752 resid_names,
00753 offset,
00754 "Scatter Temperature"));
00755 offset++;
00756 }
00757 else if ((!have_temperature_eq_ && have_temperature_)
00758 || have_transport_eq_ || have_transport_) {
00759 RCP<ParameterList> p = rcp(new ParameterList);
00760
00761 p->set<std::string>("Material Property Name", temperature);
00762 p->set<RCP<DataLayout> >("Data Layout", dl_->qp_scalar);
00763 p->set<std::string>("Coordinate Vector Name", "Coord Vec");
00764 p->set<RCP<DataLayout> >("Coordinate Vector Data Layout", dl_->qp_vector);
00765
00766 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
00767 Teuchos::ParameterList& paramList = params->sublist("Temperature");
00768 p->set<Teuchos::ParameterList*>("Parameter List", ¶mList);
00769
00770 ev = rcp(new PHAL::NSMaterialProperty<EvalT, AlbanyTraits>(*p));
00771 fm0.template registerEvaluator<EvalT>(ev);
00772 }
00773
00774 if (have_damage_eq_) {
00775 Teuchos::ArrayRCP<std::string> dof_names(1);
00776 Teuchos::ArrayRCP<std::string> resid_names(1);
00777 dof_names[0] = "Damage";
00778 resid_names[0] = dof_names[0] + " Residual";
00779 fm0.template registerEvaluator<EvalT>
00780 (evalUtils.constructGatherSolutionEvaluator_noTransient(false,
00781 dof_names,
00782 offset));
00783
00784 fm0.template registerEvaluator<EvalT>
00785 (evalUtils.constructGatherCoordinateVectorEvaluator());
00786
00787 if (!surface_element) {
00788 fm0.template registerEvaluator<EvalT>
00789 (evalUtils.constructDOFInterpolationEvaluator(dof_names[0], offset));
00790
00791 fm0.template registerEvaluator<EvalT>
00792 (evalUtils.constructDOFGradInterpolationEvaluator(dof_names[0], offset));
00793
00794 fm0.template registerEvaluator<EvalT>
00795 (evalUtils.constructMapToPhysicalFrameEvaluator(cellType,
00796 cubature));
00797
00798 fm0.template registerEvaluator<EvalT>
00799 (evalUtils.constructComputeBasisFunctionsEvaluator(cellType,
00800 intrepidBasis,
00801 cubature));
00802 }
00803
00804 fm0.template registerEvaluator<EvalT>
00805 (evalUtils.constructScatterResidualEvaluator(false,
00806 resid_names,
00807 offset,
00808 "Scatter Damage"));
00809 offset++;
00810 }
00811 else if (!have_damage_eq_ && have_damage_) {
00812 RCP<ParameterList> p = rcp(new ParameterList);
00813
00814 p->set<std::string>("Material Property Name", "Damage");
00815 p->set<RCP<DataLayout> >("Data Layout", dl_->qp_scalar);
00816 p->set<std::string>("Coordinate Vector Name", "Coord Vec");
00817 p->set<RCP<DataLayout> >("Coordinate Vector Data Layout", dl_->qp_vector);
00818
00819 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
00820 Teuchos::ParameterList& paramList = params->sublist("Damage");
00821 p->set<Teuchos::ParameterList*>("Parameter List", ¶mList);
00822
00823 ev = rcp(new PHAL::NSMaterialProperty<EvalT, AlbanyTraits>(*p));
00824 fm0.template registerEvaluator<EvalT>(ev);
00825 }
00826
00827 if (have_pressure_eq_) {
00828 Teuchos::ArrayRCP<std::string> dof_names(1);
00829 Teuchos::ArrayRCP<std::string> resid_names(1);
00830 dof_names[0] = "Pore_Pressure";
00831 resid_names[0] = dof_names[0] + " Residual";
00832
00833 fm0.template registerEvaluator<EvalT>
00834 (evalUtils.constructGatherSolutionEvaluator_noTransient(false,
00835 dof_names,
00836 offset));
00837 fm0.template registerEvaluator<EvalT>
00838 (evalUtils.constructGatherCoordinateVectorEvaluator());
00839
00840 if (!surface_element) {
00841 fm0.template registerEvaluator<EvalT>
00842 (evalUtils.constructDOFInterpolationEvaluator(dof_names[0], offset));
00843
00844 fm0.template registerEvaluator<EvalT>
00845 (evalUtils.constructDOFGradInterpolationEvaluator(dof_names[0], offset));
00846
00847 fm0.template registerEvaluator<EvalT>
00848 (evalUtils.constructMapToPhysicalFrameEvaluator(cellType,
00849 cubature));
00850
00851 fm0.template registerEvaluator<EvalT>
00852 (evalUtils.constructComputeBasisFunctionsEvaluator(cellType,
00853 intrepidBasis,
00854 cubature));
00855 }
00856
00857 fm0.template registerEvaluator<EvalT>
00858 (evalUtils.constructScatterResidualEvaluator(false,
00859 resid_names,
00860 offset,
00861 "Scatter Pore_Pressure"));
00862 offset++;
00863 }
00864 else if (have_pressure_) {
00865 RCP<ParameterList> p = rcp(new ParameterList);
00866
00867 p->set<std::string>("Material Property Name", "Pressure");
00868 p->set<RCP<DataLayout> >("Data Layout", dl_->qp_scalar);
00869 p->set<std::string>("Coordinate Vector Name", "Coord Vec");
00870 p->set<RCP<DataLayout> >("Coordinate Vector Data Layout", dl_->qp_vector);
00871
00872 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
00873 Teuchos::ParameterList& paramList = params->sublist("Pressure");
00874 p->set<Teuchos::ParameterList*>("Parameter List", ¶mList);
00875
00876 ev = rcp(new PHAL::NSMaterialProperty<EvalT, AlbanyTraits>(*p));
00877 fm0.template registerEvaluator<EvalT>(ev);
00878 }
00879
00880 if (have_transport_eq_) {
00881
00882 Teuchos::ArrayRCP<std::string> dof_names(1);
00883 Teuchos::ArrayRCP<std::string> resid_names(1);
00884 dof_names[0] = "Transport";
00885 resid_names[0] = dof_names[0] + " Residual";
00886 fm0.template registerEvaluator<EvalT>
00887 (evalUtils.constructGatherSolutionEvaluator_noTransient(false,
00888 dof_names,
00889 offset));
00890 if (!surface_element) {
00891 fm0.template registerEvaluator<EvalT>
00892 (evalUtils.constructDOFInterpolationEvaluator(dof_names[0], offset));
00893
00894 fm0.template registerEvaluator<EvalT>
00895 (evalUtils.constructDOFGradInterpolationEvaluator(dof_names[0], offset));
00896
00897 fm0.template registerEvaluator<EvalT>
00898 (evalUtils.constructMapToPhysicalFrameEvaluator(cellType,
00899 cubature));
00900
00901 fm0.template registerEvaluator<EvalT>
00902 (evalUtils.constructComputeBasisFunctionsEvaluator(cellType,
00903 intrepidBasis,
00904 cubature));
00905 }
00906
00907 fm0.template registerEvaluator<EvalT>
00908 (evalUtils.constructScatterResidualEvaluator(false,
00909 resid_names,
00910 offset,
00911 "Scatter Transport"));
00912 offset++;
00913 }
00914 else if (have_transport_) {
00915 RCP<ParameterList> p = rcp(new ParameterList);
00916
00917 p->set<std::string>("Material Property Name", "Transport");
00918 p->set<RCP<DataLayout> >("Data Layout", dl_->qp_scalar);
00919 p->set<std::string>("Coordinate Vector Name", "Coord Vec");
00920 p->set<RCP<DataLayout> >("Coordinate Vector Data Layout", dl_->qp_vector);
00921
00922 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
00923 Teuchos::ParameterList& paramList = params->sublist("Transport");
00924 p->set<Teuchos::ParameterList*>("Parameter List", ¶mList);
00925
00926 ev = rcp(new PHAL::NSMaterialProperty<EvalT, AlbanyTraits>(*p));
00927 fm0.template registerEvaluator<EvalT>(ev);
00928 }
00929
00930 if (have_hydrostress_eq_) {
00931 Teuchos::ArrayRCP<std::string> dof_names(1);
00932 Teuchos::ArrayRCP<std::string> resid_names(1);
00933 dof_names[0] = "HydroStress";
00934 resid_names[0] = dof_names[0] + " Residual";
00935 fm0.template registerEvaluator<EvalT>
00936 (evalUtils.constructGatherSolutionEvaluator_noTransient(false,
00937 dof_names,
00938 offset));
00939
00940 if (!surface_element) {
00941 fm0.template registerEvaluator<EvalT>
00942 (evalUtils.constructDOFInterpolationEvaluator(dof_names[0], offset));
00943
00944 fm0.template registerEvaluator<EvalT>
00945 (evalUtils.constructDOFGradInterpolationEvaluator(dof_names[0], offset));
00946
00947 fm0.template registerEvaluator<EvalT>
00948 (evalUtils.constructMapToPhysicalFrameEvaluator(cellType,
00949 cubature));
00950
00951 fm0.template registerEvaluator<EvalT>
00952 (evalUtils.constructComputeBasisFunctionsEvaluator(cellType,
00953 intrepidBasis,
00954 cubature));
00955 }
00956
00957 fm0.template registerEvaluator<EvalT>
00958 (evalUtils.constructScatterResidualEvaluator(false,
00959 resid_names,
00960 offset,
00961 "Scatter HydroStress"));
00962 offset++;
00963 }
00964
00965 {
00966 RCP<ParameterList> p = rcp(new ParameterList("Time"));
00967 p->set<std::string>("Time Name", "Time");
00968 p->set<std::string>("Delta Time Name", "Delta Time");
00969 p->set<RCP<DataLayout> >("Workset Scalar Data Layout", dl_->workset_scalar);
00970 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
00971 p->set<bool>("Disable Transient", true);
00972 ev = rcp(new LCM::Time<EvalT, AlbanyTraits>(*p));
00973 fm0.template registerEvaluator<EvalT>(ev);
00974 p = stateMgr.registerStateVariable("Time",
00975 dl_->workset_scalar,
00976 dl_->dummy,
00977 eb_name,
00978 "scalar",
00979 0.0,
00980 true);
00981 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
00982 fm0.template registerEvaluator<EvalT>(ev);
00983 }
00984
00985 if (have_mech_eq_) {
00986 RCP<ParameterList> p = rcp(new ParameterList("Current Coordinates"));
00987 p->set<std::string>("Reference Coordinates Name", "Coord Vec");
00988 p->set<std::string>("Displacement Name", "Displacement");
00989 p->set<std::string>("Current Coordinates Name", "Current Coordinates");
00990 ev = rcp(new LCM::CurrentCoords<EvalT, AlbanyTraits>(*p, dl_));
00991 fm0.template registerEvaluator<EvalT>(ev);
00992 }
00993
00994 if (have_temperature_eq_ || have_temperature_) {
00995 double temp(0.0);
00996 if (material_db_->isElementBlockParam(eb_name, "Initial Temperature")) {
00997 temp = material_db_->
00998 getElementBlockParam<double>(eb_name, "Initial Temperature");
00999 }
01000 RCP<ParameterList> p = rcp(new ParameterList("Save Temperature"));
01001 p = stateMgr.registerStateVariable(temperature,
01002 dl_->qp_scalar,
01003 dl_->dummy,
01004 eb_name,
01005 "scalar",
01006 temp,
01007 true,
01008 false);
01009 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01010 fm0.template registerEvaluator<EvalT>(ev);
01011 }
01012
01013 if (have_pressure_eq_ || have_pressure_) {
01014 RCP<ParameterList> p = rcp(new ParameterList("Save Pore Pressure"));
01015 p = stateMgr.registerStateVariable(porePressure,
01016 dl_->qp_scalar,
01017 dl_->dummy,
01018 eb_name,
01019 "scalar",
01020 0.0,
01021 true,
01022 false);
01023 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01024 fm0.template registerEvaluator<EvalT>(ev);
01025 }
01026
01027 if (have_transport_eq_ || have_transport_) {
01028 RCP<ParameterList> p = rcp(new ParameterList("Save Transport"));
01029 bool output_flag(true);
01030 if (material_db_->isElementBlockParam(eb_name, "Output IP"+transport))
01031 output_flag =
01032 material_db_->getElementBlockParam<bool>(eb_name, "Output IP"+transport);
01033
01034 p = stateMgr.registerStateVariable(transport,
01035 dl_->qp_scalar,
01036 dl_->dummy,
01037 eb_name,
01038 "scalar",
01039 38.7,
01040 true,
01041 output_flag);
01042 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01043 fm0.template registerEvaluator<EvalT>(ev);
01044 }
01045
01046 if (have_hydrostress_eq_ || have_hydrostress_) {
01047 RCP<ParameterList> p = rcp(new ParameterList("Save HydroStress"));
01048 p = stateMgr.registerStateVariable(hydroStress,
01049 dl_->qp_scalar,
01050 dl_->dummy,
01051 eb_name,
01052 "scalar",
01053 0.0,
01054 true,
01055 true);
01056 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01057 fm0.template registerEvaluator<EvalT>(ev);
01058 }
01059
01060 if (have_source_) {
01061 RCP<ParameterList> p = rcp(new ParameterList);
01062
01063 p->set<std::string>("Source Name", "Source");
01064 p->set<std::string>("Variable Name", "Displacement");
01065 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
01066
01067 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
01068 Teuchos::ParameterList& paramList = params->sublist("Source Functions");
01069 p->set<Teuchos::ParameterList*>("Parameter List", ¶mList);
01070
01071 ev = rcp(new PHAL::Source<EvalT, AlbanyTraits>(*p));
01072 fm0.template registerEvaluator<EvalT>(ev);
01073 }
01074
01075 {
01076 RCP<ParameterList> p = rcp(
01077 new ParameterList("Constitutive Model Parameters"));
01078 std::string matName = material_db_->getElementBlockParam<std::string>(
01079 eb_name, "material");
01080 Teuchos::ParameterList& param_list =
01081 material_db_->getElementBlockSublist(eb_name, matName);
01082 if (have_temperature_ || have_temperature_eq_) {
01083 p->set<std::string>("Temperature Name", temperature);
01084 param_list.set<bool>("Have Temperature", true);
01085 }
01086
01087
01088 p->set<std::string>("QP Coordinate Vector Name", "Coord Vec");
01089
01090
01091 p->set<Teuchos::ParameterList*>("Material Parameters", ¶m_list);
01092
01093 RCP<LCM::ConstitutiveModelParameters<EvalT, AlbanyTraits> > cmpEv =
01094 rcp(new LCM::ConstitutiveModelParameters<EvalT, AlbanyTraits>(*p, dl_));
01095 fm0.template registerEvaluator<EvalT>(cmpEv);
01096 }
01097
01098 if (have_mech_eq_) {
01099 RCP<ParameterList> p = rcp(
01100 new ParameterList("Constitutive Model Interface"));
01101 std::string matName = material_db_->getElementBlockParam<std::string>(
01102 eb_name, "material");
01103 Teuchos::ParameterList& param_list =
01104 material_db_->getElementBlockSublist(eb_name, matName);
01105
01106
01107 param_list.set<bool>("Have Temperature", false);
01108 if (have_temperature_ || have_temperature_eq_) {
01109 p->set<std::string>("Temperature Name", temperature);
01110 param_list.set<bool>("Have Temperature", true);
01111 }
01112
01113 param_list.set<RCP<std::map<std::string, std::string> > >("Name Map", fnm);
01114 p->set<Teuchos::ParameterList*>("Material Parameters", ¶m_list);
01115 p->set<bool>("Volume Average Pressure", volume_average_pressure);
01116 if (volume_average_pressure) {
01117 p->set<std::string>("Weights Name", "Weights");
01118 }
01119
01120 RCP<LCM::ConstitutiveModelInterface<EvalT, AlbanyTraits> > cmiEv =
01121 rcp(new LCM::ConstitutiveModelInterface<EvalT, AlbanyTraits>(*p, dl_));
01122 fm0.template registerEvaluator<EvalT>(cmiEv);
01123
01124
01125 for (int sv(0); sv < cmiEv->getNumStateVars(); ++sv) {
01126 cmiEv->fillStateVariableStruct(sv);
01127 p = stateMgr.registerStateVariable(cmiEv->getName(),
01128 cmiEv->getLayout(),
01129 dl_->dummy,
01130 eb_name,
01131 cmiEv->getInitType(),
01132 cmiEv->getInitValue(),
01133 cmiEv->getStateFlag(),
01134 cmiEv->getOutputFlag());
01135 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01136 fm0.template registerEvaluator<EvalT>(ev);
01137 }
01138 }
01139
01140
01141 if (surface_element)
01142 {
01143
01144 {
01145
01146 RCP<ParameterList> p = rcp(new ParameterList("Surface Basis"));
01147
01148
01149 p->set<std::string>("Reference Coordinates Name", "Coord Vec");
01150 p->set<RCP<Intrepid::Cubature<RealType> > >("Cubature", surfaceCubature);
01151 p->set<RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >(
01152 "Intrepid Basis", surfaceBasis);
01153 if (have_mech_eq_) {
01154 p->set<std::string>("Current Coordinates Name", "Current Coordinates");
01155 }
01156
01157
01158 p->set<std::string>("Reference Basis Name", "Reference Basis");
01159 p->set<std::string>("Reference Area Name", "Weights");
01160 p->set<std::string>("Reference Dual Basis Name", "Reference Dual Basis");
01161 p->set<std::string>("Reference Normal Name", "Reference Normal");
01162 p->set<std::string>("Current Basis Name", "Current Basis");
01163
01164 ev = rcp(new LCM::SurfaceBasis<EvalT, AlbanyTraits>(*p, dl_));
01165 fm0.template registerEvaluator<EvalT>(ev);
01166 }
01167
01168 if (have_mech_eq_) {
01169
01170 RCP<ParameterList> p = rcp(new ParameterList("Surface Vector Jump"));
01171
01172
01173 p->set<RCP<Intrepid::Cubature<RealType> > >("Cubature", surfaceCubature);
01174 p->set<RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >(
01175 "Intrepid Basis", surfaceBasis);
01176 p->set<std::string>("Vector Name", "Current Coordinates");
01177
01178
01179 p->set<std::string>("Vector Jump Name", "Vector Jump");
01180
01181 ev = rcp(new LCM::SurfaceVectorJump<EvalT, AlbanyTraits>(*p, dl_));
01182 fm0.template registerEvaluator<EvalT>(ev);
01183 }
01184
01185 if ((have_temperature_eq_ || have_pressure_eq_) ||
01186 (have_transport_eq_)) {
01187
01188 RCP<ParameterList> p = rcp(new ParameterList("Surface Scalar Jump"));
01189
01190
01191 p->set<RCP<Intrepid::Cubature<RealType> > >("Cubature", surfaceCubature);
01192 p->set<RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >(
01193 "Intrepid Basis", surfaceBasis);
01194 if (have_temperature_eq_) {
01195 p->set<std::string>("Nodal Temperature Name", "Temperature");
01196
01197 p->set<std::string>("Jump of Temperature Name", "Temperature Jump");
01198 p->set<std::string>("MidPlane Temperature Name", temperature);
01199 }
01200
01201 if (have_transport_eq_) {
01202 p->set<std::string>("Nodal Transport Name", "Transport");
01203
01204 p->set<std::string>("Jump of Transport Name", "Transport Jump");
01205 p->set<std::string>("MidPlane Transport Name", transport);
01206 }
01207
01208 if (have_pressure_eq_) {
01209 p->set<std::string>("Nodal Pore Pressure Name", "Pore_Pressure");
01210
01211 p->set<std::string>("Jump of Pore Pressure Name", "Pore_Pressure Jump");
01212 p->set<std::string>("MidPlane Pore Pressure Name", porePressure);
01213 }
01214
01215 if (have_hydrostress_eq_) {
01216 p->set<std::string>("Nodal HydroStress Name", "HydroStress");
01217
01218 p->set<std::string>("Jump of HydroStress Name", "HydroStress Jump");
01219 p->set<std::string>("MidPlane HydroStress Name", hydroStress);
01220 }
01221
01222 ev = rcp(new LCM::SurfaceScalarJump<EvalT, AlbanyTraits>(*p, dl_));
01223 fm0.template registerEvaluator<EvalT>(ev);
01224
01225 }
01226
01227 if (have_mech_eq_) {
01228
01229 RCP<ParameterList> p = rcp(new ParameterList("Surface Vector Gradient"));
01230
01231
01232 p->set<RealType>("thickness", thickness);
01233
01234
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244 p->set<bool>("Weighted Volume Average J", volume_average_j);
01245 p->set<RealType>("Average J Stabilization Parameter", volume_average_stabilization_param);
01246 p->set<RCP<Intrepid::Cubature<RealType> > >("Cubature", surfaceCubature);
01247 p->set<std::string>("Weights Name", "Weights");
01248 p->set<std::string>("Current Basis Name", "Current Basis");
01249 p->set<std::string>("Reference Dual Basis Name", "Reference Dual Basis");
01250 p->set<std::string>("Reference Normal Name", "Reference Normal");
01251 p->set<std::string>("Vector Jump Name", "Vector Jump");
01252
01253
01254 p->set<std::string>("Surface Vector Gradient Name", defgrad);
01255 p->set<std::string>("Surface Vector Gradient Determinant Name", J);
01256
01257 ev = rcp(new LCM::SurfaceVectorGradient<EvalT, AlbanyTraits>(*p, dl_));
01258 fm0.template registerEvaluator<EvalT>(ev);
01259
01260
01261 bool output_flag(false);
01262 if (material_db_->isElementBlockParam(eb_name,
01263 "Output Deformation Gradient"))
01264 output_flag =
01265 material_db_->getElementBlockParam<bool>(eb_name,
01266 "Output Deformation Gradient");
01267
01268 p = stateMgr.registerStateVariable(defgrad,
01269 dl_->qp_tensor,
01270 dl_->dummy,
01271 eb_name,
01272 "identity",
01273 1.0,
01274 false,
01275 output_flag);
01276 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01277 fm0.template registerEvaluator<EvalT>(ev);
01278
01279
01280 output_flag = false;
01281 if (material_db_->isElementBlockParam(eb_name, "Output J"))
01282 output_flag =
01283 material_db_->getElementBlockParam<bool>(eb_name, "Output J");
01284 if (have_pressure_eq_ || output_flag) {
01285 p = stateMgr.registerStateVariable(J,
01286 dl_->qp_scalar,
01287 dl_->dummy,
01288 eb_name,
01289 "scalar",
01290 1.0,
01291 true,
01292 output_flag);
01293 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01294 fm0.template registerEvaluator<EvalT>(ev);
01295 }
01296 }
01297
01298
01299 if (have_pressure_eq_) {
01300
01301 RCP<ParameterList> p = rcp(
01302 new ParameterList("Surface Scalar Gradient Operator"));
01303
01304 p->set<RealType>("thickness", thickness);
01305 p->set<RCP<Intrepid::Cubature<RealType> > >("Cubature", surfaceCubature);
01306 p->set<RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >(
01307 "Intrepid Basis", surfaceBasis);
01308 p->set<std::string>("Reference Dual Basis Name", "Reference Dual Basis");
01309 p->set<std::string>("Reference Normal Name", "Reference Normal");
01310
01311
01312
01313 if (have_pressure_eq_ == true)
01314 p->set<std::string>("Nodal Scalar Name", "Pore_Pressure");
01315
01316
01317 p->set<std::string>("Surface Scalar Gradient Operator Name",
01318 "Surface Scalar Gradient Operator");
01319 p->set<RCP<DataLayout> >("Node QP Vector Data Layout",
01320 dl_->node_qp_vector);
01321 p->set<std::string>("Surface Scalar Gradient Name",
01322 "Surface Pressure Gradient");
01323 p->set<RCP<DataLayout> >("QP Vector Data Layout", dl_->qp_vector);
01324
01325 ev = rcp(
01326 new LCM::SurfaceScalarGradientOperator<EvalT, AlbanyTraits>(*p, dl_));
01327 fm0.template registerEvaluator<EvalT>(ev);
01328 }
01329
01330 if (have_transport_eq_) {
01331
01332 RCP<ParameterList> p = rcp(
01333 new ParameterList("Surface Scalar Gradient Operator"));
01334
01335 p->set<RealType>("thickness", thickness);
01336 p->set<RCP<Intrepid::Cubature<RealType> > >("Cubature", surfaceCubature);
01337 p->set<RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >(
01338 "Intrepid Basis", surfaceBasis);
01339 p->set<std::string>("Reference Dual Basis Name", "Reference Dual Basis");
01340 p->set<std::string>("Reference Normal Name", "Reference Normal");
01341
01342
01343
01344 p->set<std::string>("Nodal Scalar Name", "Transport");
01345
01346
01347 p->set<std::string>("Surface Scalar Gradient Operator Name",
01348 "Surface Scalar Gradient Operator");
01349 p->set<RCP<DataLayout> >("Node QP Vector Data Layout",
01350 dl_->node_qp_vector);
01351 if (have_transport_eq_ == true)
01352 p->set<std::string>("Surface Scalar Gradient Name",
01353 "Surface Transport Gradient");
01354 p->set<RCP<DataLayout> >("QP Vector Data Layout", dl_->qp_vector);
01355
01356 ev = rcp(
01357 new LCM::SurfaceScalarGradientOperator<EvalT, AlbanyTraits>(*p, dl_));
01358 fm0.template registerEvaluator<EvalT>(ev);
01359
01360 }
01361
01362 if (have_hydrostress_eq_) {
01363
01364 RCP<ParameterList> p = rcp(
01365 new ParameterList("Surface Scalar Gradient Operator"));
01366
01367 p->set<RealType>("thickness", thickness);
01368 p->set<RCP<Intrepid::Cubature<RealType> > >("Cubature", surfaceCubature);
01369 p->set<RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >(
01370 "Intrepid Basis", surfaceBasis);
01371 p->set<std::string>("Reference Dual Basis Name", "Reference Dual Basis");
01372 p->set<std::string>("Reference Normal Name", "Reference Normal");
01373
01374
01375
01376 if (have_transport_eq_ == true)
01377 p->set<std::string>("Nodal Scalar Name", "HydroStress");
01378
01379
01380 p->set<std::string>("Surface Scalar Gradient Operator Name",
01381 "Surface Scalar Gradient Operator");
01382 p->set<RCP<DataLayout> >("Node QP Vector Data Layout",
01383 dl_->node_qp_vector);
01384 p->set<std::string>("Surface Scalar Gradient Name",
01385 "Surface HydroStress Gradient");
01386 p->set<RCP<DataLayout> >("QP Vector Data Layout", dl_->qp_vector);
01387
01388 ev = rcp(
01389 new LCM::SurfaceScalarGradientOperator<EvalT, AlbanyTraits>(*p, dl_));
01390 fm0.template registerEvaluator<EvalT>(ev);
01391 }
01392
01393 {
01394 if (have_mech_eq_) {
01395
01396 RCP<ParameterList> p = rcp(
01397 new ParameterList("Surface Vector Residual"));
01398
01399
01400 p->set<RealType>("thickness", thickness);
01401 p->set<RCP<Intrepid::Cubature<RealType> > >("Cubature",
01402 surfaceCubature);
01403 p->set<RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >(
01404 "Intrepid Basis", surfaceBasis);
01405
01406 p->set<bool>("Compute Membrane Forces", compute_membrane_forces);
01407
01408 p->set<std::string>("Stress Name", firstPK);
01409 p->set<std::string>("Current Basis Name", "Current Basis");
01410 p->set<std::string>("Reference Dual Basis Name",
01411 "Reference Dual Basis");
01412 p->set<std::string>("Reference Normal Name", "Reference Normal");
01413 p->set<std::string>("Reference Area Name", "Weights");
01414
01415 if (cohesive_element) {
01416 p->set<bool>("Use Cohesive Traction", true);
01417 p->set<std::string>("Cohesive Traction Name", "Cohesive_Traction");
01418 }
01419
01420
01421 p->set<std::string>("Surface Vector Residual Name",
01422 "Displacement Residual");
01423
01424 ev = rcp(new LCM::SurfaceVectorResidual<EvalT, AlbanyTraits>(*p, dl_));
01425 fm0.template registerEvaluator<EvalT>(ev);
01426 }
01427 }
01428 } else {
01429
01430 if (have_mech_eq_) {
01431 RCP<ParameterList> p = rcp(new ParameterList("Kinematics"));
01432
01433 p->set<bool>("Weighted Volume Average J", volume_average_j);
01434 p->set<RealType>("Average J Stabilization Parameter", volume_average_stabilization_param);
01435
01436
01437 if (small_strain) {
01438 p->set<std::string>("Strain Name", "Strain");
01439 }
01440
01441
01442 bool have_velocity_gradient(false);
01443 if (material_db_->isElementBlockParam(eb_name,
01444 "Velocity Gradient Flag")) {
01445 p->set<bool>("Velocity Gradient Flag",
01446 material_db_->
01447 getElementBlockParam<bool>(eb_name, "Velocity Gradient Flag"));
01448 have_velocity_gradient = material_db_->
01449 getElementBlockParam<bool>(eb_name, "Velocity Gradient Flag");
01450 if (have_velocity_gradient)
01451 p->set<std::string>("Velocity Gradient Name", "Velocity Gradient");
01452 }
01453
01454
01455 p->set<std::string>("Weights Name", "Weights");
01456 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
01457 p->set<std::string>("Gradient QP Variable Name", "Displacement Gradient");
01458 p->set<RCP<DataLayout> >("QP Tensor Data Layout", dl_->qp_tensor);
01459
01460
01461 p->set<std::string>("DefGrad Name", defgrad);
01462 p->set<std::string>("DetDefGrad Name", J);
01463 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
01464
01465
01466 ev = rcp(new LCM::Kinematics<EvalT, AlbanyTraits>(*p, dl_));
01467 fm0.template registerEvaluator<EvalT>(ev);
01468
01469
01470 bool output_flag(false);
01471 if (material_db_->isElementBlockParam(eb_name,
01472 "Output Deformation Gradient"))
01473 output_flag =
01474 material_db_->getElementBlockParam<bool>(eb_name,
01475 "Output Deformation Gradient");
01476
01477 if (output_flag) {
01478 p = stateMgr.registerStateVariable(defgrad,
01479 dl_->qp_tensor,
01480 dl_->dummy,
01481 eb_name,
01482 "identity",
01483 1.0,
01484 false,
01485 output_flag);
01486 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01487 fm0.template registerEvaluator<EvalT>(ev);
01488 }
01489
01490
01491 output_flag = false;
01492 if (material_db_->isElementBlockParam(eb_name, "Output J"))
01493 output_flag =
01494 material_db_->getElementBlockParam<bool>(eb_name, "Output J");
01495 if (have_pressure_eq_ || output_flag) {
01496 p = stateMgr.registerStateVariable(J,
01497 dl_->qp_scalar,
01498 dl_->dummy,
01499 eb_name,
01500 "scalar",
01501 1.0,
01502 true,
01503 output_flag);
01504 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01505 fm0.template registerEvaluator<EvalT>(ev);
01506 }
01507
01508
01509 if (small_strain) {
01510 output_flag = false;
01511 if (material_db_->isElementBlockParam(eb_name, "Output Strain"))
01512 output_flag =
01513 material_db_->getElementBlockParam<bool>(eb_name,
01514 "Output Strain");
01515
01516 if (output_flag) {
01517 p = stateMgr.registerStateVariable("Strain",
01518 dl_->qp_tensor,
01519 dl_->dummy,
01520 eb_name,
01521 "scalar",
01522 0.0,
01523 false,
01524 output_flag);
01525 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01526 fm0.template registerEvaluator<EvalT>(ev);
01527 }
01528 }
01529
01530
01531 if (have_velocity_gradient) {
01532 output_flag = false;
01533 if (material_db_->isElementBlockParam(eb_name,
01534 "Output Velocity Gradient"))
01535 output_flag =
01536 material_db_->getElementBlockParam<bool>(eb_name,
01537 "Output Velocity Gradient");
01538
01539 if (output_flag) {
01540 p = stateMgr.registerStateVariable("Velocity Gradient",
01541 dl_->qp_tensor,
01542 dl_->dummy,
01543 eb_name,
01544 "scalar",
01545 0.0,
01546 false,
01547 output_flag);
01548 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01549 fm0.template registerEvaluator<EvalT>(ev);
01550 }
01551 }
01552 }
01553 if (have_mech_eq_)
01554 {
01555 RCP<ParameterList> p = rcp(new ParameterList("Displacement Residual"));
01556
01557 p->set<std::string>("Stress Name", firstPK);
01558 p->set<std::string>("Weighted Gradient BF Name", "wGrad BF");
01559 p->set<std::string>("Weighted BF Name", "wBF");
01560 p->set<std::string>("Acceleration Name", "Acceleration");
01561
01562 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
01563
01564 p->set<std::string>("Residual Name", "Displacement Residual");
01565 ev = rcp(new LCM::MechanicsResidual<EvalT, AlbanyTraits>(*p, dl_));
01566 fm0.template registerEvaluator<EvalT>(ev);
01567 }
01568 }
01569
01570
01571 if (have_mech_eq_) {
01572
01573 RCP<ParameterList> p = rcp(new ParameterList("First PK Stress"));
01574
01575 p->set<std::string>("Stress Name", cauchy);
01576 p->set<std::string>("DefGrad Name", defgrad);
01577
01578
01579 if (have_pressure_eq_) {
01580 p->set<bool>("Have Pore Pressure", true);
01581 p->set<std::string>("Pore Pressure Name", porePressure);
01582 p->set<std::string>("Biot Coefficient Name", biotCoeff);
01583 }
01584
01585 if (small_strain) {
01586 p->set<bool>("Small Strain", true);
01587 }
01588
01589
01590 p->set<std::string>("First PK Stress Name", firstPK);
01591
01592 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
01593
01594 ev = rcp(new LCM::FirstPK<EvalT, AlbanyTraits>(*p, dl_));
01595 fm0.template registerEvaluator<EvalT>(ev);
01596 }
01597
01598
01599 if ((have_pressure_eq_ || have_transport_eq_)) {
01600 RCP<ParameterList> p = rcp(new ParameterList("Gradient_Element_Length"));
01601
01602 if (!surface_element) {
01603 if (have_pressure_eq_) {
01604 p->set<std::string>("Unit Gradient QP Variable Name",
01605 "Pore_Pressure Gradient");
01606 } else if (have_transport_eq_) {
01607 p->set<std::string>("Unit Gradient QP Variable Name",
01608 "Transport Gradient");
01609 }
01610 p->set<std::string>("Gradient BF Name", "Grad BF");
01611 }
01612 else {
01613 if (have_pressure_eq_) {
01614 p->set<std::string>("Unit Gradient QP Variable Name",
01615 "Surface Pressure Gradient");
01616 }
01617 if (have_transport_eq_) {
01618 p->set<std::string>("Unit Gradient QP Variable Name",
01619 "Surface Transport Gradient");
01620 }
01621 p->set<std::string>("Gradient BF Name",
01622 "Surface Scalar Gradient Operator");
01623
01624 }
01625
01626
01627 p->set<std::string>("Element Length Name", gradientElementLength);
01628
01629 ev = rcp(new LCM::GradientElementLength<EvalT, AlbanyTraits>(*p, dl_));
01630 fm0.template registerEvaluator<EvalT>(ev);
01631 }
01632
01633 if (have_pressure_eq_) {
01634 RCP<ParameterList> p = rcp(new ParameterList);
01635
01636 p->set<std::string>("Porosity Name", porosity);
01637 p->set<std::string>("QP Coordinate Vector Name", "Coord Vec");
01638
01639
01640 if (have_mech_eq_) p->set<std::string>("DetDefGrad Name", J);
01641
01642 p->set<std::string>("QP Pore Pressure Name", porePressure);
01643 p->set<std::string>("Biot Coefficient Name", biotCoeff);
01644
01645 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
01646 Teuchos::ParameterList& paramList =
01647 material_db_->getElementBlockSublist(eb_name, "Porosity");
01648 p->set<Teuchos::ParameterList*>("Parameter List", ¶mList);
01649
01650 ev = rcp(new LCM::Porosity<EvalT, AlbanyTraits>(*p, dl_));
01651 fm0.template registerEvaluator<EvalT>(ev);
01652
01653
01654 bool output_flag(false);
01655 if (material_db_->isElementBlockParam(eb_name, "Output "+porosity))
01656 output_flag =
01657 material_db_->getElementBlockParam<bool>(eb_name, "Output "+porosity);
01658 if (output_flag) {
01659 p = stateMgr.registerStateVariable(porosity,
01660 dl_->qp_scalar,
01661 dl_->dummy,
01662 eb_name,
01663 "scalar",
01664 0.5,
01665 false,
01666 true);
01667 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01668 fm0.template registerEvaluator<EvalT>(ev);
01669 }
01670 }
01671
01672 if (have_pressure_eq_) {
01673 RCP<ParameterList> p = rcp(new ParameterList);
01674
01675 p->set<std::string>("Biot Coefficient Name", biotCoeff);
01676 p->set<std::string>("QP Coordinate Vector Name", "Coord Vec");
01677 p->set<RCP<DataLayout> >("Node Data Layout", dl_->node_scalar);
01678 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
01679 p->set<RCP<DataLayout> >("QP Vector Data Layout", dl_->qp_vector);
01680
01681 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
01682 Teuchos::ParameterList& paramList =
01683 material_db_->getElementBlockSublist(eb_name, "Biot Coefficient");
01684 p->set<Teuchos::ParameterList*>("Parameter List", ¶mList);
01685
01686 ev = rcp(new LCM::BiotCoefficient<EvalT, AlbanyTraits>(*p));
01687 fm0.template registerEvaluator<EvalT>(ev);
01688 }
01689
01690 if (have_pressure_eq_) {
01691 RCP<ParameterList> p = rcp(new ParameterList);
01692
01693 p->set<std::string>("Biot Modulus Name", biotModulus);
01694 p->set<std::string>("QP Coordinate Vector Name", "Coord Vec");
01695 p->set<RCP<DataLayout> >("Node Data Layout", dl_->node_scalar);
01696 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
01697 p->set<RCP<DataLayout> >("QP Vector Data Layout", dl_->qp_vector);
01698
01699 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
01700 Teuchos::ParameterList& paramList =
01701 material_db_->getElementBlockSublist(eb_name, "Biot Modulus");
01702 p->set<Teuchos::ParameterList*>("Parameter List", ¶mList);
01703
01704
01705 p->set<std::string>("Porosity Name", porosity);
01706 p->set<std::string>("Biot Coefficient Name", biotCoeff);
01707
01708 ev = rcp(new LCM::BiotModulus<EvalT, AlbanyTraits>(*p));
01709 fm0.template registerEvaluator<EvalT>(ev);
01710 }
01711
01712 if (have_pressure_eq_) {
01713 RCP<ParameterList> p = rcp(new ParameterList);
01714
01715 p->set<std::string>("Kozeny-Carman Permeability Name", kcPerm);
01716 p->set<std::string>("QP Coordinate Vector Name", "Coord Vec");
01717 p->set<RCP<DataLayout> >("Node Data Layout", dl_->node_scalar);
01718 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
01719 p->set<RCP<DataLayout> >("QP Vector Data Layout", dl_->qp_vector);
01720
01721 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
01722 Teuchos::ParameterList& paramList =
01723 material_db_->getElementBlockSublist(eb_name,
01724 "Kozeny-Carman Permeability");
01725 p->set<Teuchos::ParameterList*>("Parameter List", ¶mList);
01726
01727
01728 p->set<std::string>("Porosity Name", porosity);
01729 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
01730
01731 ev = rcp(new LCM::KCPermeability<EvalT, AlbanyTraits>(*p));
01732 fm0.template registerEvaluator<EvalT>(ev);
01733
01734
01735 bool output_flag(false);
01736 if (material_db_->isElementBlockParam(eb_name, "Output "+kcPerm))
01737 output_flag =
01738 material_db_->getElementBlockParam<bool>(eb_name, "Output "+kcPerm);
01739 if (output_flag) {
01740 p = stateMgr.registerStateVariable(kcPerm,
01741 dl_->qp_scalar,
01742 dl_->dummy,
01743 eb_name,
01744 "scalar",
01745 0.0,
01746 false,
01747 true);
01748 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01749 fm0.template registerEvaluator<EvalT>(ev);
01750 }
01751 }
01752
01753
01754 if (have_pressure_eq_ && !surface_element) {
01755 RCP<ParameterList> p = rcp(new ParameterList("Pore_Pressure Residual"));
01756
01757
01758
01759
01760 p->set<std::string>("Weights Name", "Weights");
01761 p->set<std::string>("Weighted BF Name", "wBF");
01762 p->set<RCP<DataLayout> >("Node QP Scalar Data Layout",
01763 dl_->node_qp_scalar);
01764 p->set<std::string>("Weighted Gradient BF Name", "wGrad BF");
01765 p->set<RCP<DataLayout> >("Node QP Vector Data Layout", dl_->node_qp_vector);
01766
01767
01768 p->set<std::string>("Coordinate Vector Name", "Coord Vec");
01769 p->set<RCP<DataLayout> >("Coordinate Data Layout", dl_->vertices_vector);
01770 p->set<RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
01771 p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
01772
01773
01774 p->set<std::string>("Delta Time Name", "Delta Time");
01775 p->set<RCP<DataLayout> >("Workset Scalar Data Layout", dl_->workset_scalar);
01776
01777 p->set<bool>("Have Source", false);
01778 p->set<std::string>("Source Name", "Source");
01779 p->set<bool>("Have Absorption", false);
01780
01781
01782 p->set<std::string>("Element Length Name", gradientElementLength);
01783 p->set<std::string>("QP Pore Pressure Name", porePressure);
01784 p->set<std::string>("QP Time Derivative Variable Name", porePressure);
01785 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
01786
01787
01788 p->set<std::string>("Porosity Name", "Porosity");
01789 p->set<std::string>("Thermal Conductivity Name", "Thermal Conductivity");
01790 p->set<std::string>("Kozeny-Carman Permeability Name", kcPerm);
01791 p->set<std::string>("Biot Coefficient Name", biotCoeff);
01792 p->set<std::string>("Biot Modulus Name", biotModulus);
01793
01794 p->set<std::string>("Gradient QP Variable Name", "Pore_Pressure Gradient");
01795 p->set<RCP<DataLayout> >("QP Vector Data Layout", dl_->qp_vector);
01796
01797 if (have_mech_eq_) {
01798 p->set<bool>("Have Mechanics", true);
01799 p->set<std::string>("DefGrad Name", defgrad);
01800 p->set<RCP<DataLayout> >("QP Tensor Data Layout", dl_->qp_tensor);
01801 p->set<std::string>("DetDefGrad Name", J);
01802 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
01803 }
01804 RealType stab_param(0.0);
01805 if (material_db_->isElementBlockParam(eb_name, "Stabilization Parameter")) {
01806 stab_param =
01807 material_db_->getElementBlockParam<RealType>(eb_name,
01808 "Stabilization Parameter");
01809 }
01810
01811 p->set<RealType>("Stabilization Parameter", stab_param);
01812
01813 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
01814
01815
01816 p->set<std::string>("Residual Name", "Pore_Pressure Residual");
01817 p->set<RCP<DataLayout> >("Node Scalar Data Layout", dl_->node_scalar);
01818
01819 ev = rcp(new LCM::TLPoroPlasticityResidMass<EvalT, AlbanyTraits>(*p));
01820 fm0.template registerEvaluator<EvalT>(ev);
01821
01822
01823 bool output_flag(false);
01824 if (material_db_->isElementBlockParam(eb_name, "Output IP"+porePressure))
01825 output_flag =
01826 material_db_->getElementBlockParam<bool>(eb_name, "Output IP"+porePressure);
01827 p = stateMgr.registerStateVariable(porePressure,
01828 dl_->qp_scalar,
01829 dl_->dummy,
01830 eb_name,
01831 "scalar",
01832 0.0,
01833 true,
01834 output_flag);
01835 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01836 fm0.template registerEvaluator<EvalT>(ev);
01837 }
01838
01839 if (have_pressure_eq_ && surface_element) {
01840 RCP<ParameterList> p = rcp(new ParameterList("Pore_Pressure Residual"));
01841
01842
01843 p->set<RealType>("thickness", thickness);
01844 p->set<RCP<Intrepid::Cubature<RealType> > >("Cubature", surfaceCubature);
01845 p->set<RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >(
01846 "Intrepid Basis", surfaceBasis);
01847 p->set<std::string>("Surface Scalar Gradient Operator Name",
01848 "Surface Scalar Gradient Operator");
01849 p->set<std::string>("Scalar Gradient Name", "Surface Pressure Gradient");
01850 p->set<std::string>("Current Basis Name", "Current Basis");
01851 p->set<std::string>("Reference Dual Basis Name", "Reference Dual Basis");
01852 p->set<std::string>("Reference Normal Name", "Reference Normal");
01853 p->set<std::string>("Reference Area Name", "Weights");
01854 p->set<std::string>("Pore Pressure Name", porePressure);
01855 p->set<std::string>("Nodal Pore Pressure Name", "Pore_Pressure");
01856 p->set<std::string>("Biot Coefficient Name", biotCoeff);
01857 p->set<std::string>("Biot Modulus Name", biotModulus);
01858 p->set<std::string>("Kozeny-Carman Permeability Name", kcPerm);
01859 p->set<std::string>("Delta Time Name", "Delta Time");
01860 if (have_mech_eq_) {
01861 p->set<std::string>("DefGrad Name", defgrad);
01862 p->set<std::string>("DetDefGrad Name", J);
01863 }
01864
01865
01866 p->set<std::string>("Residual Name", "Pore_Pressure Residual");
01867 p->set<RCP<DataLayout> >("Node Scalar Data Layout", dl_->node_scalar);
01868
01869 ev = rcp(new LCM::SurfaceTLPoroMassResidual<EvalT, AlbanyTraits>(*p, dl_));
01870 fm0.template registerEvaluator<EvalT>(ev);
01871 }
01872
01873 if (have_transport_eq_ || have_transport_) {
01874 RCP<ParameterList> p = rcp(new ParameterList("Transport Coefficients"));
01875
01876 std::string matName = material_db_->getElementBlockParam<std::string>(
01877 eb_name, "material");
01878 Teuchos::ParameterList& param_list = material_db_->
01879 getElementBlockSublist(eb_name, matName).sublist(
01880 "Transport Coefficients");
01881 p->set<Teuchos::ParameterList*>("Material Parameters", ¶m_list);
01882
01883
01884 p->set<std::string>("Lattice Concentration Name", transport);
01885 p->set<std::string>("Deformation Gradient Name", defgrad);
01886 p->set<std::string>("Determinant of F Name", J);
01887 p->set<std::string>("Temperature Name", temperature);
01888 if (materialModelName == "J2" || materialModelName == "Creep") {
01889 p->set<std::string>("Equivalent Plastic Strain Name", eqps);
01890 }
01891
01892 p->set<bool>("Weighted Volume Average J", volume_average_j);
01893 p->set<RealType>("Average J Stabilization Parameter", volume_average_stabilization_param);
01894
01895
01896 p->set<std::string>("Trapped Concentration Name", trappedConcentration);
01897 p->set<std::string>("Mechanical Deformation Gradient Name", trappedConcentration);
01898 p->set<std::string>("Total Concentration Name", totalConcentration);
01899 p->set<std::string>("Mechanical Deformation Gradient Name", "Fm");
01900 p->set<std::string>("Effective Diffusivity Name", effectiveDiffusivity);
01901 p->set<std::string>("Trapped Solvent Name", trappedSolvent);
01902 if (materialModelName == "J2" || materialModelName == "Creep") {
01903 p->set<std::string>("Strain Rate Factor Name", strainRateFactor);
01904 }
01905 p->set<std::string>("Diffusion Coefficient Name", diffusionCoefficient);
01906 p->set<std::string>("Tau Contribution Name", convectionCoefficient);
01907 p->set<std::string>("Concentration Equilibrium Parameter Name",
01908 eqilibriumParameter);
01909
01910 ev = rcp(new LCM::TransportCoefficients<EvalT, AlbanyTraits>(*p, dl_));
01911 fm0.template registerEvaluator<EvalT>(ev);
01912
01913 bool output_flag(false);
01914
01915 if (material_db_->isElementBlockParam(eb_name, "Output "+trappedConcentration))
01916 output_flag =
01917 material_db_->getElementBlockParam<bool>(eb_name, "Output "+trappedConcentration);
01918 if (output_flag) {
01919 p = stateMgr.registerStateVariable(trappedConcentration, dl_->qp_scalar,
01920 dl_->dummy, eb_name, "scalar", 0.0, false, output_flag);
01921 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01922 fm0.template registerEvaluator<EvalT>(ev);
01923 }
01924
01925
01926 output_flag = false;
01927 if (material_db_->isElementBlockParam(eb_name, "Output "+strainRateFactor))
01928 output_flag =
01929 material_db_->getElementBlockParam<bool>(eb_name, "Output "+strainRateFactor);
01930 if (output_flag) {
01931 p = stateMgr.registerStateVariable(strainRateFactor, dl_->qp_scalar,
01932 dl_->dummy, eb_name, "scalar", 0.0, false, output_flag);
01933 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01934 fm0.template registerEvaluator<EvalT>(ev);
01935 }
01936
01937
01938 output_flag = false;
01939 if (material_db_->isElementBlockParam(eb_name, "Output "+convectionCoefficient))
01940 output_flag =
01941 material_db_->getElementBlockParam<bool>(eb_name, "Output "+convectionCoefficient);
01942 if (output_flag) {
01943 p = stateMgr.registerStateVariable(convectionCoefficient, dl_->qp_scalar,
01944 dl_->dummy, eb_name, "scalar", 0.0, false, output_flag);
01945 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01946 fm0.template registerEvaluator<EvalT>(ev);
01947 }
01948
01949
01950 output_flag = false;
01951 if (material_db_->isElementBlockParam(eb_name, "Output "+diffusionCoefficient))
01952 output_flag =
01953 material_db_->getElementBlockParam<bool>(eb_name, "Output "+diffusionCoefficient);
01954 if (output_flag) {
01955 p = stateMgr.registerStateVariable(diffusionCoefficient, dl_->qp_scalar,
01956 dl_->dummy, eb_name,"scalar", 1.0, false, output_flag);
01957 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01958 fm0.template registerEvaluator<EvalT>(ev);
01959 }
01960
01961
01962 output_flag = false;
01963 if (material_db_->isElementBlockParam(eb_name, "Output "+effectiveDiffusivity))
01964 output_flag =
01965 material_db_->getElementBlockParam<bool>(eb_name, "Output "+effectiveDiffusivity);
01966 if (output_flag) {
01967 p = stateMgr.registerStateVariable(effectiveDiffusivity, dl_->qp_scalar,
01968 dl_->dummy, eb_name,"scalar", 1.0, false, output_flag);
01969 ev = rcp(new PHAL::SaveStateField<EvalT, AlbanyTraits>(*p));
01970 fm0.template registerEvaluator<EvalT>(ev);
01971 }
01972 }
01973
01974
01975 if (have_temperature_eq_ && !surface_element)
01976 {
01977 RCP<ParameterList> p = rcp(
01978 new ParameterList("ThermoMechanical Coefficients"));
01979
01980 std::string matName =
01981 material_db_->getElementBlockParam<std::string>(eb_name, "material");
01982 Teuchos::ParameterList& param_list =
01983 material_db_->getElementBlockSublist(eb_name, matName);
01984 p->set<Teuchos::ParameterList*>("Material Parameters", ¶m_list);
01985
01986
01987 p->set<std::string>("Temperature Name", "Temperature");
01988 p->set<std::string>("Thermal Conductivity Name", "Thermal Conductivity");
01989 p->set<std::string>("Thermal Transient Coefficient Name",
01990 "Thermal Transient Coefficient");
01991 p->set<std::string>("Delta Time Name", "Delta Time");
01992
01993 if (have_mech_eq_) {
01994 p->set<bool>("Have Mechanics", true);
01995 p->set<std::string>("Deformation Gradient Name", defgrad);
01996 }
01997
01998
01999 p->set<std::string>("Thermal Diffusivity Name", "Thermal Diffusivity");
02000 p->set<std::string>("Temperature Dot Name", "Temperature Dot");
02001
02002 ev = rcp(
02003 new LCM::ThermoMechanicalCoefficients<EvalT, AlbanyTraits>(*p, dl_));
02004 fm0.template registerEvaluator<EvalT>(ev);
02005 }
02006
02007
02008 if (have_temperature_eq_ && !surface_element)
02009 {
02010 RCP<ParameterList> p = rcp(new ParameterList("Temperature Residual"));
02011
02012
02013 p->set<std::string>("Scalar Variable Name", "Temperature");
02014 p->set<std::string>("Scalar Gradient Variable Name",
02015 "Temperature Gradient");
02016 p->set<std::string>("Weights Name", "Weights");
02017 p->set<std::string>("Weighted Gradient BF Name", "wGrad BF");
02018 p->set<std::string>("Weighted BF Name", "wBF");
02019
02020
02021 p->set<bool>("Have Transient", true);
02022 p->set<std::string>("Scalar Dot Name", "Temperature Dot");
02023 p->set<std::string>("Transient Coefficient Name",
02024 "Thermal Transient Coefficient");
02025
02026
02027 p->set<bool>("Have Diffusion", true);
02028 p->set<std::string>("Diffusivity Name", "Thermal Diffusivity");
02029
02030
02031 if ((have_mech_ || have_mech_eq_) && materialModelName == "J2" || materialModelName == "Creep") {
02032 p->set<bool>("Have Source", true);
02033 p->set<std::string>("Source Name", mech_source);
02034 }
02035
02036
02037 p->set<std::string>("Residual Name", "Temperature Residual");
02038
02039 ev = rcp(new LCM::TransportResidual<EvalT, AlbanyTraits>(*p, dl_));
02040 fm0.template registerEvaluator<EvalT>(ev);
02041 }
02042
02043
02044 if (have_transport_eq_ && !surface_element) {
02045 RCP<ParameterList> p = rcp(new ParameterList("Transport Residual"));
02046
02047
02048 p->set<std::string>("Element Length Name", gradientElementLength);
02049 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
02050
02051 p->set<std::string>("Weighted BF Name", "wBF");
02052 p->set<RCP<DataLayout> >("Node QP Scalar Data Layout", dl_->node_qp_scalar);
02053
02054 p->set<std::string>("Weights Name", "Weights");
02055 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
02056
02057 p->set<std::string>("Weighted Gradient BF Name", "wGrad BF");
02058 p->set<RCP<DataLayout> >("Node QP Vector Data Layout", dl_->node_qp_vector);
02059
02060 p->set<std::string>("Gradient BF Name", "Grad BF");
02061 p->set<RCP<DataLayout> >("Node QP Vector Data Layout", dl_->node_qp_vector);
02062
02063 if (have_mech_eq_) {
02064 p->set<std::string>("eqps Name", eqps);
02065 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
02066
02067 p->set<std::string>("Strain Rate Factor Name", strainRateFactor);
02068 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
02069
02070 p->set<std::string>("Tau Contribution Name", convectionCoefficient);
02071 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
02072 }
02073
02074 p->set<std::string>("Trapped Concentration Name", trappedConcentration);
02075 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
02076
02077 p->set<std::string>("Trapped Solvent Name", trappedSolvent);
02078 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
02079
02080 p->set<std::string>("Deformation Gradient Name", defgrad);
02081 p->set<RCP<DataLayout> >("QP Tensor Data Layout", dl_->qp_tensor);
02082
02083 p->set<std::string>("Effective Diffusivity Name", effectiveDiffusivity);
02084 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
02085
02086 p->set<std::string>("Diffusion Coefficient Name", diffusionCoefficient);
02087 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
02088
02089 p->set<std::string>("QP Variable Name", "Transport");
02090 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
02091
02092 p->set<std::string>("Gradient QP Variable Name", "Transport Gradient");
02093 p->set<RCP<DataLayout> >("QP Vector Data Layout", dl_->qp_vector);
02094
02095 p->set<std::string>("Gradient Hydrostatic Stress Name",
02096 "HydroStress Gradient");
02097 p->set<RCP<DataLayout> >("QP Vector Data Layout", dl_->qp_vector);
02098
02099 p->set<std::string>("Stress Name", cauchy);
02100 p->set<RCP<DataLayout> >("QP Tensor Data Layout", dl_->qp_tensor);
02101
02102 p->set<std::string>("Delta Time Name", "Delta Time");
02103 p->set<RCP<DataLayout> >("Workset Scalar Data Layout", dl_->workset_scalar);
02104
02105 RealType stab_param(0.0);
02106 if (material_db_->isElementBlockParam(eb_name, "Stabilization Parameter")) {
02107 stab_param =
02108 material_db_->getElementBlockParam<RealType>(eb_name,
02109 "Stabilization Parameter");
02110 }
02111 p->set<RealType>("Stabilization Parameter", stab_param);
02112 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
02113
02114
02115 p->set<std::string>("Residual Name", "Transport Residual");
02116 p->set<RCP<DataLayout> >("Node Scalar Data Layout", dl_->node_scalar);
02117
02118 ev = rcp(
02119 new LCM::HDiffusionDeformationMatterResidual<EvalT, AlbanyTraits>(*p));
02120 fm0.template registerEvaluator<EvalT>(ev);
02121
02122 }
02123
02124 if (have_transport_eq_ && surface_element) {
02125 RCP<ParameterList> p = rcp(new ParameterList("Transport Residual"));
02126
02127
02128 p->set<RealType>("thickness", thickness);
02129 p->set<RCP<Intrepid::Cubature<RealType> > >("Cubature", surfaceCubature);
02130 p->set<RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >(
02131 "Intrepid Basis", surfaceBasis);
02132 p->set<std::string>("Surface Scalar Gradient Operator Name",
02133 "Surface Scalar Gradient Operator");
02134 p->set<std::string>("Surface Transport Gradient Name",
02135 "Surface Transport Gradient");
02136 p->set<std::string>("Current Basis Name", "Current Basis");
02137 p->set<std::string>("Reference Dual Basis Name", "Reference Dual Basis");
02138 p->set<std::string>("Reference Normal Name", "Reference Normal");
02139 p->set<std::string>("Reference Area Name", "Weights");
02140 p->set<std::string>("Transport Name", transport);
02141 p->set<std::string>("Nodal Transport Name", "Transport");
02142 p->set<std::string>("Diffusion Coefficient Name", diffusionCoefficient);
02143 p->set<std::string>("Effective Diffusivity Name", effectiveDiffusivity);
02144 p->set<std::string>("Tau Contribution Name", convectionCoefficient);
02145 p->set<std::string>("Strain Rate Factor Name", strainRateFactor);
02146 p->set<std::string>("Element Length Name", effectiveDiffusivity);
02147 p->set<std::string>("Surface HydroStress Gradient Name",
02148 "Surface HydroStress Gradient");
02149 p->set<std::string>("eqps Name", eqps);
02150 p->set<std::string>("Delta Time Name", "Delta Time");
02151 if (have_mech_eq_) {
02152 p->set<std::string>("DefGrad Name", defgrad);
02153 p->set<std::string>("DetDefGrad Name", J);
02154 }
02155
02156 RealType stab_param(0.0);
02157 if (material_db_->isElementBlockParam(eb_name, "Stabilization Parameter")) {
02158 stab_param =
02159 material_db_->getElementBlockParam<RealType>(eb_name,
02160 "Stabilization Parameter");
02161 }
02162 p->set<RealType>("Stabilization Parameter", stab_param);
02163 p->set<RCP<ParamLib> >("Parameter Library", paramLib);
02164
02165
02166 p->set<std::string>("Residual Name", "Transport Residual");
02167 p->set<RCP<DataLayout> >("Node Scalar Data Layout", dl_->node_scalar);
02168
02169 ev = rcp(new LCM::SurfaceHDiffusionDefResidual<EvalT, AlbanyTraits>(*p, dl_));
02170 fm0.template registerEvaluator<EvalT>(ev);
02171
02172 }
02173
02174
02175 if (have_hydrostress_eq_ && !surface_element) {
02176 RCP<ParameterList> p = rcp(new ParameterList("HydroStress Residual"));
02177
02178
02179 p->set<std::string>("Weighted BF Name", "wBF");
02180 p->set<RCP<DataLayout> >
02181 ("Node QP Scalar Data Layout", dl_->node_qp_scalar);
02182
02183 p->set<std::string>("Weighted Gradient BF Name", "wGrad BF");
02184 p->set<RCP<DataLayout> >
02185 ("Node QP Vector Data Layout", dl_->node_qp_vector);
02186
02187 p->set<bool>("Have Source", false);
02188 p->set<std::string>("Source Name", "Source");
02189
02190 p->set<std::string>("Deformation Gradient Name", defgrad);
02191 p->set<RCP<DataLayout> >("QP Tensor Data Layout", dl_->qp_tensor);
02192
02193 p->set<std::string>("QP Variable Name", hydroStress);
02194 p->set<RCP<DataLayout> >("QP Scalar Data Layout", dl_->qp_scalar);
02195
02196 p->set<std::string>("Stress Name", cauchy);
02197 p->set<RCP<DataLayout> >("QP Tensor Data Layout", dl_->qp_tensor);
02198
02199
02200 p->set<std::string>("Residual Name", "HydroStress Residual");
02201 p->set<RCP<DataLayout> >("Node Scalar Data Layout", dl_->node_scalar);
02202
02203 ev = rcp(new LCM::ScalarL2ProjectionResidual<EvalT, AlbanyTraits>(*p));
02204 fm0.template registerEvaluator<EvalT>(ev);
02205 }
02206
02207 if (have_hydrostress_eq_ && surface_element) {
02208 RCP<ParameterList> p = rcp(new ParameterList("HydroStress Residual"));
02209
02210
02211 p->set<RealType>("thickness", thickness);
02212 p->set<RCP<Intrepid::Cubature<RealType> > >("Cubature", surfaceCubature);
02213 p->set<RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >(
02214 "Intrepid Basis", surfaceBasis);
02215 p->set<std::string>("Surface Scalar Gradient Operator Name",
02216 "Surface Scalar Gradient Operator");
02217 p->set<std::string>("Current Basis Name", "Current Basis");
02218 p->set<std::string>("Reference Dual Basis Name", "Reference Dual Basis");
02219 p->set<std::string>("Reference Normal Name", "Reference Normal");
02220 p->set<std::string>("Reference Area Name", "Weights");
02221 p->set<std::string>("HydoStress Name", hydroStress);
02222 p->set<std::string>("Cauchy Stress Name", cauchy);
02223 p->set<std::string>("Jacobian Name", J);
02224
02225
02226 p->set<std::string>("Residual Name", "HydroStress Residual");
02227 p->set<RCP<DataLayout> >("Node Scalar Data Layout", dl_->node_scalar);
02228
02229 ev = rcp(
02230 new LCM::SurfaceL2ProjectionResidual<EvalT, AlbanyTraits>(*p, dl_));
02231 fm0.template registerEvaluator<EvalT>(ev);
02232 }
02233
02234 if (fieldManagerChoice == Albany::BUILD_RESID_FM) {
02235
02236 Teuchos::RCP<const PHX::FieldTag> ret_tag;
02237 if (have_mech_eq_) {
02238 PHX::Tag<typename EvalT::ScalarT> res_tag("Scatter", dl_->dummy);
02239 fm0.requireField<EvalT>(res_tag);
02240 ret_tag = res_tag.clone();
02241 }
02242 if (have_pressure_eq_) {
02243 PHX::Tag<typename EvalT::ScalarT> pres_tag("Scatter Pore_Pressure",
02244 dl_->dummy);
02245 fm0.requireField<EvalT>(pres_tag);
02246 ret_tag = pres_tag.clone();
02247 }
02248 if (have_temperature_eq_) {
02249 PHX::Tag<typename EvalT::ScalarT> temperature_tag("Scatter Temperature",
02250 dl_->dummy);
02251 fm0.requireField<EvalT>(temperature_tag);
02252 ret_tag = temperature_tag.clone();
02253 }
02254 if (have_transport_eq_) {
02255 PHX::Tag<typename EvalT::ScalarT> transport_tag("Scatter Transport",
02256 dl_->dummy);
02257 fm0.requireField<EvalT>(transport_tag);
02258 ret_tag = transport_tag.clone();
02259 }
02260 if (have_hydrostress_eq_) {
02261 PHX::Tag<typename EvalT::ScalarT> l2projection_tag("Scatter HydroStress",
02262 dl_->dummy);
02263 fm0.requireField<EvalT>(l2projection_tag);
02264 ret_tag = l2projection_tag.clone();
02265 }
02266 return ret_tag;
02267 }
02268 else if (fieldManagerChoice == Albany::BUILD_RESPONSE_FM) {
02269
02270 Albany::ResponseUtilities<EvalT, PHAL::AlbanyTraits> respUtils(dl_);
02271 return respUtils.constructResponses(fm0, *responseList, pFromProb, stateMgr);
02272
02273 }
02274
02275 return Teuchos::null;
02276 }
02277
02278 #endif