Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #if !defined(LCM_ConstitutiveModel_hpp)
00008 #define LCM_ConstitutiveModel_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 namespace LCM
00017 {
00018
00020 template<typename EvalT, typename Traits>
00021 class ConstitutiveModel
00022 {
00023 public:
00024
00025 typedef typename EvalT::ScalarT ScalarT;
00026 typedef typename EvalT::MeshScalarT MeshScalarT;
00027
00031 ConstitutiveModel(Teuchos::ParameterList* p,
00032 const Teuchos::RCP<Albany::Layouts>& dl);
00033
00037 virtual
00038 ~ConstitutiveModel()
00039 {};
00040
00044 virtual
00045 void
00046 computeState(
00047 typename Traits::EvalData workset,
00048 std::map<std::string, Teuchos::RCP<PHX::MDField<ScalarT> > > dep_fields,
00049 std::map<std::string, Teuchos::RCP<PHX::MDField<ScalarT> > > eval_fields) = 0;
00050
00054 void
00055 computeVolumeAverage(
00056 typename Traits::EvalData workset,
00057 std::map<std::string, Teuchos::RCP<PHX::MDField<ScalarT> > > dep_fields,
00058 std::map<std::string, Teuchos::RCP<PHX::MDField<ScalarT> > > eval_fields);
00059
00063 std::map<std::string, Teuchos::RCP<PHX::DataLayout> >
00064 getDependentFieldMap()
00065 {
00066 return dep_field_map_;
00067 }
00068
00072 std::map<std::string, Teuchos::RCP<PHX::DataLayout> >
00073 getEvaluatedFieldMap()
00074 {
00075 return eval_field_map_;
00076 }
00077
00081 std::string getStateVarName(int state_var);
00082 Teuchos::RCP<PHX::DataLayout> getStateVarLayout(int state_var);
00083 std::string getStateVarInitType(int state_var);
00084 double getStateVarInitValue(int state_var);
00085 bool getStateVarOldStateFlag(int state_var);
00086 bool getStateVarOutputFlag(int state_var);
00087
00091 int getNumStateVariables()
00092 {
00093 return num_state_variables_;
00094 }
00095
00099 bool
00100 getIntegrationPointLocationFlag()
00101 {
00102 return need_integration_pt_locations_;
00103 }
00104
00108 void
00109 setCoordVecField(PHX::MDField<MeshScalarT, Cell, QuadPoint, Dim> coord_vec)
00110 {
00111 coord_vec_ = coord_vec;
00112 }
00113
00117 void
00118 setTemperatureField(PHX::MDField<ScalarT, Cell, QuadPoint> temperature)
00119 {
00120 temperature_ = temperature;
00121 }
00122
00126 void
00127 setDamageField(PHX::MDField<ScalarT, Cell, QuadPoint> damage)
00128 {
00129 damage_ = damage;
00130 }
00131
00135 void
00136 setWeightsField(PHX::MDField<MeshScalarT, Cell, QuadPoint> weights)
00137 {
00138 weights_ = weights;
00139 }
00140
00141 protected:
00142
00146 int num_state_variables_;
00147
00151 std::size_t num_dims_;
00152
00156 std::size_t num_pts_;
00157
00161 bool need_integration_pt_locations_;
00162
00166 bool compute_energy_;
00167
00171 bool compute_tangent_;
00172
00176 bool have_temperature_;
00177
00181 bool have_damage_;
00182
00186 PHX::MDField<MeshScalarT, Cell, QuadPoint, Dim> coord_vec_;
00187
00191 PHX::MDField<ScalarT, Cell, QuadPoint> temperature_;
00192
00196 PHX::MDField<ScalarT, Cell, QuadPoint> damage_;
00197
00201 PHX::MDField<MeshScalarT, Cell, QuadPoint> weights_;
00202
00206 Teuchos::RCP<std::map<std::string, std::string> > field_name_map_;
00207
00208 std::vector<std::string> state_var_names_;
00209 std::vector<Teuchos::RCP<PHX::DataLayout> > state_var_layouts_;
00210 std::vector<std::string> state_var_init_types_;
00211 std::vector<double> state_var_init_values_;
00212 std::vector<bool> state_var_old_state_flags_;
00213 std::vector<bool> state_var_output_flags_;
00214
00215 std::map<std::string, Teuchos::RCP<PHX::DataLayout> > dep_field_map_;
00216 std::map<std::string, Teuchos::RCP<PHX::DataLayout> > eval_field_map_;
00217
00221 RealType expansion_coeff_;
00222
00226 RealType ref_temperature_;
00227
00231 RealType heat_capacity_;
00232
00236 RealType density_;
00237
00238 private:
00242 ConstitutiveModel(const ConstitutiveModel&);
00243
00247 ConstitutiveModel& operator=(const ConstitutiveModel&);
00248
00249 };
00250 }
00251
00252 #endif