00001
00002
00003
00004
00005
00006 #include "Albany_EvaluatorUtils.hpp"
00007 #include "Albany_DataTypes.hpp"
00008
00009 #include "Intrepid_HGRAD_LINE_Cn_FEM.hpp"
00010
00011 #include "PHAL_GatherSolution.hpp"
00012 #include "PHAL_GatherCoordinateVector.hpp"
00013 #include "PHAL_GatherSHeight.hpp"
00014 #include "PHAL_GatherTemperature.hpp"
00015 #include "PHAL_GatherFlowFactor.hpp"
00016 #include "PHAL_GatherSurfaceVelocity.hpp"
00017 #include "PHAL_GatherVelocityRMS.hpp"
00018 #include "PHAL_ScatterResidual.hpp"
00019 #include "PHAL_MapToPhysicalFrame.hpp"
00020 #include "PHAL_ComputeBasisFunctions.hpp"
00021 #include "PHAL_DOFInterpolation.hpp"
00022 #include "PHAL_DOFGradInterpolation.hpp"
00023 #include "PHAL_DOFVecInterpolation.hpp"
00024 #include "PHAL_DOFVecGradInterpolation.hpp"
00025
00026
00027
00028 template<typename EvalT, typename Traits>
00029 Albany::EvaluatorUtils<EvalT,Traits>::EvaluatorUtils(
00030 Teuchos::RCP<Albany::Layouts> dl_) :
00031 dl(dl_)
00032 {
00033 }
00034
00035
00036 template<typename EvalT, typename Traits>
00037 Teuchos::RCP< PHX::Evaluator<Traits> >
00038 Albany::EvaluatorUtils<EvalT,Traits>::constructGatherSolutionEvaluator(
00039 bool isVectorField,
00040 Teuchos::ArrayRCP<std::string> dof_names,
00041 Teuchos::ArrayRCP<std::string> dof_names_dot,
00042 int offsetToFirstDOF)
00043 {
00044 using Teuchos::RCP;
00045 using Teuchos::rcp;
00046 using Teuchos::ParameterList;
00047 using std::string;
00048
00049 RCP<ParameterList> p = rcp(new ParameterList("Gather Solution"));
00050 p->set< Teuchos::ArrayRCP<string> >("Solution Names", dof_names);
00051
00052 p->set<bool>("Vector Field", isVectorField);
00053
00054 p->set<int>("Offset of First DOF", offsetToFirstDOF);
00055
00056 p->set< Teuchos::ArrayRCP<string> >("Time Dependent Solution Names", dof_names_dot);
00057 return rcp(new PHAL::GatherSolution<EvalT,Traits>(*p,dl));
00058 }
00059
00060 template<typename EvalT, typename Traits>
00061 Teuchos::RCP< PHX::Evaluator<Traits> >
00062 Albany::EvaluatorUtils<EvalT,Traits>::constructGatherSolutionEvaluator_withAcceleration(
00063 bool isVectorField,
00064 Teuchos::ArrayRCP<std::string> dof_names,
00065 Teuchos::ArrayRCP<std::string> dof_names_dot,
00066 Teuchos::ArrayRCP<std::string> dof_names_dotdot,
00067 int offsetToFirstDOF)
00068 {
00069 using Teuchos::RCP;
00070 using Teuchos::rcp;
00071 using Teuchos::ParameterList;
00072 using std::string;
00073
00074 RCP<ParameterList> p = rcp(new ParameterList("Gather Solution"));
00075 p->set< Teuchos::ArrayRCP<string> >("Solution Names", dof_names);
00076
00077 p->set<bool>("Vector Field", isVectorField);
00078
00079 p->set<int>("Offset of First DOF", offsetToFirstDOF);
00080
00081 if (dof_names_dot != Teuchos::null)
00082 p->set< Teuchos::ArrayRCP<string> >("Time Dependent Solution Names", dof_names_dot);
00083 else
00084 p->set<bool>("Disable Transient", true);
00085
00086 if (dof_names_dotdot != Teuchos::null) {
00087 p->set< Teuchos::ArrayRCP<string> >("Solution Acceleration Names", dof_names_dotdot);
00088 p->set<bool>("Enable Acceleration", true);
00089 }
00090
00091 return rcp(new PHAL::GatherSolution<EvalT,Traits>(*p,dl));
00092 }
00093
00094 template<typename EvalT, typename Traits>
00095 Teuchos::RCP< PHX::Evaluator<Traits> >
00096 Albany::EvaluatorUtils<EvalT,Traits>::constructGatherSolutionEvaluator_noTransient(
00097 bool isVectorField,
00098 Teuchos::ArrayRCP<std::string> dof_names,
00099 int offsetToFirstDOF)
00100 {
00101 using Teuchos::RCP;
00102 using Teuchos::rcp;
00103 using Teuchos::ParameterList;
00104 using std::string;
00105
00106 RCP<ParameterList> p = rcp(new ParameterList("Gather Solution"));
00107 p->set< Teuchos::ArrayRCP<string> >("Solution Names", dof_names);
00108
00109 p->set<bool>("Vector Field", isVectorField);
00110
00111 p->set<int>("Offset of First DOF", offsetToFirstDOF);
00112 p->set<bool>("Disable Transient", true);
00113
00114 return rcp(new PHAL::GatherSolution<EvalT,Traits>(*p,dl));
00115 }
00116
00117
00118 template<typename EvalT, typename Traits>
00119 Teuchos::RCP< PHX::Evaluator<Traits> >
00120 Albany::EvaluatorUtils<EvalT,Traits>::constructScatterResidualEvaluator(
00121 bool isVectorField,
00122 Teuchos::ArrayRCP<std::string> resid_names,
00123 int offsetToFirstDOF, std::string scatterName)
00124 {
00125 using Teuchos::RCP;
00126 using Teuchos::rcp;
00127 using Teuchos::ParameterList;
00128 using std::string;
00129
00130 RCP<ParameterList> p = rcp(new ParameterList("Scatter Residual"));
00131 p->set< Teuchos::ArrayRCP<string> >("Residual Names", resid_names);
00132
00133 p->set<bool>("Vector Field", isVectorField);
00134
00135 p->set<int>("Offset of First DOF", offsetToFirstDOF);
00136 p->set<string>("Scatter Field Name", scatterName);
00137
00138 return rcp(new PHAL::ScatterResidual<EvalT,Traits>(*p,dl));
00139 }
00140
00141 template<typename EvalT, typename Traits>
00142 Teuchos::RCP< PHX::Evaluator<Traits> >
00143 Albany::EvaluatorUtils<EvalT,Traits>::constructGatherCoordinateVectorEvaluator()
00144 {
00145 using Teuchos::RCP;
00146 using Teuchos::rcp;
00147 using Teuchos::ParameterList;
00148 using std::string;
00149
00150 RCP<ParameterList> p = rcp(new ParameterList("Gather Coordinate Vector"));
00151
00152
00153 p->set<bool>("Periodic BC", false);
00154
00155
00156 p->set<string>("Coordinate Vector Name", "Coord Vec");
00157
00158 return rcp(new PHAL::GatherCoordinateVector<EvalT,Traits>(*p,dl));
00159 }
00160
00161 template<typename EvalT, typename Traits>
00162 Teuchos::RCP< PHX::Evaluator<Traits> >
00163 Albany::EvaluatorUtils<EvalT,Traits>::constructGatherSHeightEvaluator()
00164 {
00165 using Teuchos::RCP;
00166 using Teuchos::rcp;
00167 using Teuchos::ParameterList;
00168 using std::string;
00169
00170 RCP<ParameterList> p = rcp(new ParameterList("Gather Surface Height"));
00171
00172
00173 p->set<string>("Surface Height Name", "Surface Height");
00174
00175 return rcp(new PHAL::GatherSHeight<EvalT,Traits>(*p,dl));
00176 }
00177
00178 template<typename EvalT, typename Traits>
00179 Teuchos::RCP< PHX::Evaluator<Traits> >
00180 Albany::EvaluatorUtils<EvalT,Traits>::constructGatherTemperatureEvaluator()
00181 {
00182 using Teuchos::RCP;
00183 using Teuchos::rcp;
00184 using Teuchos::ParameterList;
00185
00186 RCP<ParameterList> p = rcp(new ParameterList("Gather Temperature"));
00187
00188
00189 p->set<std::string >("Temperature Name", "Temperature");
00190
00191 return rcp(new PHAL::GatherTemperature<EvalT,Traits>(*p,dl));
00192 }
00193
00194
00195 template<typename EvalT, typename Traits>
00196 Teuchos::RCP< PHX::Evaluator<Traits> >
00197 Albany::EvaluatorUtils<EvalT,Traits>::constructGatherSurfaceVelocityEvaluator()
00198 {
00199 using Teuchos::RCP;
00200 using Teuchos::rcp;
00201 using Teuchos::ParameterList;
00202
00203 RCP<ParameterList> p = rcp(new ParameterList("Gather Surface Velocity"));
00204
00205
00206 p->set<std::string >("Surface Velocity Name", "Surface Velocity");
00207
00208 return rcp(new PHAL::GatherSurfaceVelocity<EvalT,Traits>(*p,dl));
00209 }
00210
00211 template<typename EvalT, typename Traits>
00212 Teuchos::RCP< PHX::Evaluator<Traits> >
00213 Albany::EvaluatorUtils<EvalT,Traits>::constructGatherVelocityRMSEvaluator()
00214 {
00215 using Teuchos::RCP;
00216 using Teuchos::rcp;
00217 using Teuchos::ParameterList;
00218
00219 RCP<ParameterList> p = rcp(new ParameterList("Gather Velocity RMS"));
00220
00221
00222 p->set<std::string >("Velocity RMS Name", "Velocity RMS");
00223
00224 return rcp(new PHAL::GatherVelocityRMS<EvalT,Traits>(*p,dl));
00225 }
00226
00227 template<typename EvalT, typename Traits>
00228 Teuchos::RCP< PHX::Evaluator<Traits> >
00229 Albany::EvaluatorUtils<EvalT,Traits>::constructGatherFlowFactorEvaluator()
00230 {
00231 using Teuchos::RCP;
00232 using Teuchos::rcp;
00233 using Teuchos::ParameterList;
00234
00235 RCP<ParameterList> p = rcp(new ParameterList("Gather Flow Factor"));
00236
00237
00238 p->set<std::string >("Flow Factor Name", "Flow Factor");
00239
00240 return rcp(new PHAL::GatherFlowFactor<EvalT,Traits>(*p,dl));
00241 }
00242
00243
00244 template<typename EvalT, typename Traits>
00245 Teuchos::RCP< PHX::Evaluator<Traits> >
00246 Albany::EvaluatorUtils<EvalT,Traits>::constructMapToPhysicalFrameEvaluator(
00247 const Teuchos::RCP<shards::CellTopology>& cellType,
00248 const Teuchos::RCP<Intrepid::Cubature<RealType> > cubature)
00249 {
00250 using Teuchos::RCP;
00251 using Teuchos::rcp;
00252 using Teuchos::ParameterList;
00253 using std::string;
00254
00255 RCP<ParameterList> p = rcp(new ParameterList("Map To Physical Frame"));
00256
00257
00258 p->set<string>("Coordinate Vector Name", "Coord Vec");
00259 p->set<RCP <Intrepid::Cubature<RealType> > >("Cubature", cubature);
00260 p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00261
00262
00263
00264 return rcp(new PHAL::MapToPhysicalFrame<EvalT,Traits>(*p,dl));
00265 }
00266
00267 template<typename EvalT, typename Traits>
00268 Teuchos::RCP< PHX::Evaluator<Traits> >
00269 Albany::EvaluatorUtils<EvalT,Traits>::constructComputeBasisFunctionsEvaluator(
00270 const Teuchos::RCP<shards::CellTopology>& cellType,
00271 const Teuchos::RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > intrepidBasis,
00272 const Teuchos::RCP<Intrepid::Cubature<RealType> > cubature)
00273 {
00274 using Teuchos::RCP;
00275 using Teuchos::rcp;
00276 using Teuchos::ParameterList;
00277 using std::string;
00278
00279 RCP<ParameterList> p = rcp(new ParameterList("Compute Basis Functions"));
00280
00281
00282 p->set<string>("Coordinate Vector Name","Coord Vec");
00283 p->set< RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
00284
00285 p->set< RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >
00286 ("Intrepid Basis", intrepidBasis);
00287
00288 p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00289
00290 p->set<string>("Weights Name", "Weights");
00291 p->set<string>("Jacobian Det Name", "Jacobian Det");
00292 p->set<string>("BF Name", "BF");
00293 p->set<string>("Weighted BF Name", "wBF");
00294
00295 p->set<string>("Gradient BF Name", "Grad BF");
00296 p->set<string>("Weighted Gradient BF Name", "wGrad BF");
00297
00298 return rcp(new PHAL::ComputeBasisFunctions<EvalT,Traits>(*p,dl));
00299 }
00300
00301 template<typename EvalT, typename Traits>
00302 Teuchos::RCP< PHX::Evaluator<Traits> >
00303 Albany::EvaluatorUtils<EvalT,Traits>::constructDOFInterpolationEvaluator(
00304 std::string& dof_name,
00305 int offsetToFirstDOF)
00306 {
00307 using Teuchos::RCP;
00308 using Teuchos::rcp;
00309 using Teuchos::ParameterList;
00310 using std::string;
00311
00312 RCP<ParameterList> p = rcp(new ParameterList("DOF Interpolation "+dof_name));
00313
00314 p->set<string>("Variable Name", dof_name);
00315 p->set<string>("BF Name", "BF");
00316 p->set<int>("Offset of First DOF", offsetToFirstDOF);
00317
00318
00319
00320 return rcp(new PHAL::DOFInterpolation<EvalT,Traits>(*p,dl));
00321 }
00322
00323 template<typename EvalT, typename Traits>
00324 Teuchos::RCP< PHX::Evaluator<Traits> >
00325 Albany::EvaluatorUtils<EvalT,Traits>::constructDOFGradInterpolationEvaluator(
00326 std::string& dof_name,
00327 int offsetToFirstDOF)
00328 {
00329 using Teuchos::RCP;
00330 using Teuchos::rcp;
00331 using Teuchos::ParameterList;
00332 using std::string;
00333
00334 RCP<ParameterList> p = rcp(new ParameterList("DOF Grad Interpolation "+dof_name));
00335
00336 p->set<string>("Variable Name", dof_name);
00337 p->set<string>("Gradient BF Name", "Grad BF");
00338 p->set<int>("Offset of First DOF", offsetToFirstDOF);
00339
00340
00341 p->set<string>("Gradient Variable Name", dof_name+" Gradient");
00342
00343 return rcp(new PHAL::DOFGradInterpolation<EvalT,Traits>(*p,dl));
00344 }
00345
00346 template<typename EvalT, typename Traits>
00347 Teuchos::RCP< PHX::Evaluator<Traits> >
00348 Albany::EvaluatorUtils<EvalT,Traits>::constructDOFGradInterpolationEvaluator_noDeriv(
00349 std::string& dof_name)
00350 {
00351 using Teuchos::RCP;
00352 using Teuchos::rcp;
00353 using Teuchos::ParameterList;
00354 using std::string;
00355
00356 RCP<ParameterList> p = rcp(new ParameterList("DOF Grad Interpolation "+dof_name));
00357
00358 p->set<string>("Variable Name", dof_name);
00359 p->set<string>("Gradient BF Name", "Grad BF");
00360
00361
00362 p->set<string>("Gradient Variable Name", dof_name+" Gradient");
00363
00364 return rcp(new PHAL::DOFGradInterpolation_noDeriv<EvalT,Traits>(*p,dl));
00365 }
00366
00367 template<typename EvalT, typename Traits>
00368 Teuchos::RCP< PHX::Evaluator<Traits> >
00369 Albany::EvaluatorUtils<EvalT,Traits>::constructDOFVecInterpolationEvaluator(
00370 std::string& dof_name,
00371 int offsetToFirstDOF)
00372 {
00373 using Teuchos::RCP;
00374 using Teuchos::rcp;
00375 using Teuchos::ParameterList;
00376 using std::string;
00377
00378 RCP<ParameterList> p = rcp(new ParameterList("DOFVec Interpolation "+dof_name));
00379
00380 p->set<string>("Variable Name", dof_name);
00381 p->set<string>("BF Name", "BF");
00382 p->set<int>("Offset of First DOF", offsetToFirstDOF);
00383
00384
00385
00386 return rcp(new PHAL::DOFVecInterpolation<EvalT,Traits>(*p,dl));
00387 }
00388
00389 template<typename EvalT, typename Traits>
00390 Teuchos::RCP< PHX::Evaluator<Traits> >
00391 Albany::EvaluatorUtils<EvalT,Traits>::constructDOFVecGradInterpolationEvaluator(
00392 std::string& dof_name,
00393 int offsetToFirstDOF)
00394 {
00395 using Teuchos::RCP;
00396 using Teuchos::rcp;
00397 using Teuchos::ParameterList;
00398 using std::string;
00399
00400 RCP<ParameterList> p = rcp(new ParameterList("DOFVecGrad Interpolation "+dof_name));
00401
00402 p->set<string>("Variable Name", dof_name);
00403 p->set<string>("Gradient BF Name", "Grad BF");
00404 p->set<int>("Offset of First DOF", offsetToFirstDOF);
00405
00406
00407 p->set<string>("Gradient Variable Name", dof_name+" Gradient");
00408
00409 return rcp(new PHAL::DOFVecGradInterpolation<EvalT,Traits>(*p,dl));
00410 }