Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_PointDescriptor.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 
12 
13 #include "Panzer_HashUtils.hpp"
14 
15 #include "Teuchos_Assert.hpp"
16 
17 namespace panzer
18 {
19 
21 PointDescriptor(const std::string & type,const Teuchos::RCP<PointGenerator> & generator)
22 {
23  setup(type,generator);
24 }
25 
26 void
28 setup(const std::string & type,const Teuchos::RCP<PointGenerator> & generator)
29 {
30  _type = type;
31  _generator = generator;
32 
33  // sanity check
34  TEUCHOS_ASSERT(_generator!=Teuchos::null);
35 
36  _key = std::hash<PointDescriptor>()(*this);
37 }
38 
39 }
40 
41 std::size_t
43 {
44  std::size_t seed = 0;
45  const std::string prefix = "point_desc";
46 
47  panzer::hash_combine(seed,prefix); // prevent collisions with other descriptors
48  panzer::hash_combine(seed,desc.getType());
49 
50  return seed;
51 }
Teuchos::RCP< PointGenerator > _generator
PointGenerator object to build the points.
std::size_t _key
Unique key associated with integrator.
PointDescriptor()=delete
Default constructor, no version.
void setup(const std::string &type, const Teuchos::RCP< PointGenerator > &generator)
Setup the point descriptor. Protected and used by constructors.
std::string _type
Type string.
const std::string & getType() const
Get unique string associated with the type of point descriptor. This will be used generate a hash to ...
void hash_combine(std::size_t &seed, const T &v)
#define TEUCHOS_ASSERT(assertion_test)
std::size_t operator()(const panzer::PointDescriptor &desc) const