Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "Teuchos_TestForException.hpp"
00008 #include "Phalanx_DataLayout.hpp"
00009
00010 #include <Intrepid_MiniTensor.h>
00011
00012 #include <typeinfo>
00013
00014 namespace LCM {
00015
00016
00017 template<typename EvalT, typename Traits>
00018 BifurcationCheck<EvalT, Traits>::
00019 BifurcationCheck(const Teuchos::ParameterList& p,
00020 const Teuchos::RCP<Albany::Layouts>& dl) :
00021 tangent_(p.get<std::string>("Material Tangent Name"),dl->qp_tensor4),
00022 ellipticity_flag_(p.get<std::string>("Ellipticity Flag Name"),dl->qp_scalar),
00023 direction_(p.get<std::string>("Bifurcation Direction Name"),dl->qp_vector)
00024 {
00025 std::vector<PHX::DataLayout::size_type> dims;
00026 dl->qp_tensor->dimensions(dims);
00027 num_pts_ = dims[1];
00028 num_dims_ = dims[2];
00029
00030 this->addDependentField(tangent_);
00031
00032 this->addEvaluatedField(ellipticity_flag_);
00033 this->addEvaluatedField(direction_);
00034
00035 this->setName("BifurcationCheck"+PHX::TypeString<EvalT>::value);
00036 }
00037
00038
00039 template<typename EvalT, typename Traits>
00040 void BifurcationCheck<EvalT, Traits>::
00041 postRegistrationSetup(typename Traits::SetupData d,
00042 PHX::FieldManager<Traits>& fm)
00043 {
00044 this->utils.setFieldData(tangent_,fm);
00045 this->utils.setFieldData(ellipticity_flag_,fm);
00046 this->utils.setFieldData(direction_,fm);
00047 }
00048
00049
00050 template<typename EvalT, typename Traits>
00051 void BifurcationCheck<EvalT, Traits>::
00052 evaluateFields(typename Traits::EvalData workset)
00053 {
00054 Intrepid::Vector<ScalarT> direction(1.0, 0.0, 0.0);
00055 Intrepid::Tensor4<ScalarT> tangent(num_dims_);
00056
00057
00058 for (std::size_t cell(0); cell < workset.numCells; ++cell) {
00059 for (std::size_t pt(0); pt < num_pts_; ++pt) {
00060
00061 tangent.fill( &tangent_(cell,pt,0,0,0,0) );
00062 ellipticity_flag_(cell,pt) = 0;
00063
00064
00065
00066 for (std::size_t i(0); i < num_dims_; ++i) {
00067 direction_(cell,pt,i) = direction(i);
00068 }
00069 }
00070 }
00071 }
00072
00073 }