Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #if !defined(LCM_ConstitutiveModelInterface_hpp)
00008 #define LCM_ConstitutiveModelInterface_hpp
00009
00010 #include "Phalanx_ConfigDefs.hpp"
00011 #include "Phalanx_Evaluator_WithBaseImpl.hpp"
00012 #include "Phalanx_Evaluator_Derived.hpp"
00013 #include "Phalanx_MDField.hpp"
00014 #include "Albany_Layouts.hpp"
00015
00016 #include "models/ConstitutiveModel.hpp"
00017
00018 namespace LCM {
00019
00021 struct StateVariableRegistrationStruct {
00022 public:
00023 std::string name;
00024 Teuchos::RCP<PHX::DataLayout> data_layout;
00025 std::string init_type;
00026 double init_value;
00027 bool register_old_state;
00028 bool output_to_exodus;
00029 };
00030
00032 template<typename EvalT, typename Traits>
00033 class ConstitutiveModelInterface : public PHX::EvaluatorWithBaseImpl<Traits>,
00034 public PHX::EvaluatorDerived<EvalT, Traits> {
00035
00036 public:
00037
00041 ConstitutiveModelInterface(Teuchos::ParameterList& p,
00042 const Teuchos::RCP<Albany::Layouts>& dl);
00043
00047 void postRegistrationSetup(typename Traits::SetupData d,
00048 PHX::FieldManager<Traits>& vm);
00049
00053 void evaluateFields(typename Traits::EvalData d);
00054
00058 void fillStateVariableStruct(int state_var);
00059
00063 int getNumStateVars() { return model_->getNumStateVariables(); }
00064
00068 void initializeModel(Teuchos::ParameterList* p,
00069 const Teuchos::RCP<Albany::Layouts>& dl);
00070
00074 std::string getName() { return sv_struct_.name; }
00075
00079 Teuchos::RCP<PHX::DataLayout> getLayout() { return sv_struct_.data_layout; }
00080
00084 std::string getInitType() { return sv_struct_.init_type; }
00085
00089 double getInitValue() { return sv_struct_.init_value; }
00090
00094 double getStateFlag() { return sv_struct_.register_old_state; }
00095
00099 double getOutputFlag() { return sv_struct_.output_to_exodus; }
00100
00101 private:
00102
00103 typedef typename EvalT::ScalarT ScalarT;
00104 typedef typename EvalT::MeshScalarT MeshScalarT;
00105
00109 std::map<std::string, Teuchos::RCP<PHX::MDField<ScalarT> > > dep_fields_map_;
00110
00114 std::map<std::string, Teuchos::RCP<PHX::MDField<ScalarT> > > eval_fields_map_;
00115
00119 Teuchos::RCP<LCM::ConstitutiveModel<EvalT,Traits> > model_;
00120
00124 StateVariableRegistrationStruct sv_struct_;
00125
00129 PHX::MDField<MeshScalarT,Cell,QuadPoint,Dim> coord_vec_;
00130
00134 PHX::MDField<ScalarT,Cell,QuadPoint> temperature_;
00135
00139 PHX::MDField<ScalarT,Cell,QuadPoint> damage_;
00140
00144 PHX::MDField<MeshScalarT,Cell,QuadPoint> weights_;
00145
00149 bool have_temperature_;
00150
00154 bool have_damage_;
00155
00159 bool volume_average_pressure_;
00160 };
00161
00162 }
00163
00164 #endif