Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_ParameterLibraryUtilities.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Panzer: A partial differential equation assembly
4 // engine for strongly coupled complex multiphysics systems
5 //
6 // Copyright 2011 NTESS and the Panzer contributors.
7 // SPDX-License-Identifier: BSD-3-Clause
8 // *****************************************************************************
9 // @HEADER
10 
11 #ifndef PANZER_PARAMETER_LIBRARY_UTILITIES_CPP
12 #define PANZER_PARAMETER_LIBRARY_UTILITIES_CPP
13 
15 
16 namespace panzer {
17 
18 struct RegisterScalarParameter {
19  std::string name;
21 
22  template <typename T>
23  void apply() const
24  { createAndRegisterScalarParameter<T>(name,*pl); }
25 };
26 
27 void registerScalarParameter(const std::string name,panzer::ParamLib& pl,double realValue)
28 {
29  RegisterScalarParameter rsp;
30  rsp.name = name;
31  rsp.pl = Teuchos::ptrFromRef(pl);
32 
33  rsp.apply<panzer::Traits::Residual>();
34  rsp.apply<panzer::Traits::Jacobian>();
35  rsp.apply<panzer::Traits::Tangent>();
36 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
37  rsp.apply<panzer::Traits::Hessian>();
38 #endif // Panzer_BUILD_HESSIAN_SUPPORT
39 
40  pl.setRealValueForAllTypes(name,realValue);
41 }
42 
43 }
44 
45 #endif
Sacado::ScalarParameterLibrary< panzer::EvaluationTraits > ParamLib
void registerScalarParameter(const std::string name, panzer::ParamLib &pl, double realValue)