Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_ResponseEvaluatorFactory_IPCoordinates_impl.hpp
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_ResponseEvaluatorFactory_IPCoordinates_impl_hpp__
12 #define __Panzer_ResponseEvaluatorFactory_IPCoordinates_impl_hpp__
13 
14 #include <string>
15 #include <sstream>
16 
17 #include "PanzerDiscFE_config.hpp"
18 
20 #include "Panzer_PhysicsBlock.hpp"
21 #include "Panzer_Integrator_Scalar.hpp"
24 
25 namespace panzer {
26 
27 template <typename EvalT>
29 buildResponseObject(const std::string & responseName,const std::vector<WorksetDescriptor> & wkstDesc) const
30 {
31  // check that the input worksets constains only element blocks
32  bool failure = false;
33  std::stringstream failureStrm;
34  for(std::size_t i=0;i<wkstDesc.size();i++) {
35  failure |= wkstDesc[i].useSideset();
36  failureStrm << wkstDesc[i] << std::endl;
37  }
38  TEUCHOS_TEST_FOR_EXCEPTION(failure,std::runtime_error,
39  "REF_IPCoordinates::buildResponseObject: could not build using side set descriptors:\n"
40  << failureStrm.str());
41 
42  return Teuchos::rcp(new Response_IPCoordinates<EvalT>(responseName));
43 }
44 
45 template <typename EvalT>
47 buildAndRegisterEvaluators(const std::string & responseName,
49  const panzer::PhysicsBlock& /* physicsBlock */,
50  const Teuchos::ParameterList& /* user_data */) const
51 {
52  using Teuchos::RCP;
53  using Teuchos::rcp;
54 
55  // build scatter evaluator
56  {
57  // build useful evaluator
60 
61  this->template registerEvaluator<EvalT>(fm, eval);
62 
63  // require last field
64  fm.template requireField<EvalT>(*eval->evaluatedFields()[0]);
65  }
66 }
67 
68 template <typename EvalT>
71 {
72  return false;
73 }
74 
75 template < >
78 {
79  return true;
80 }
81 
82 }
83 
84 #endif
Object that contains information on the physics and discretization of a block of elements with the SA...
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual void buildAndRegisterEvaluators(const std::string &responseName, PHX::FieldManager< panzer::Traits > &fm, const panzer::PhysicsBlock &physicsBlock, const Teuchos::ParameterList &user_data) const
virtual Teuchos::RCP< ResponseBase > buildResponseObject(const std::string &responseName, const std::vector< WorksetDescriptor > &eBlocks) const