Panzer Version of the Day
Loading...
Searching...
No Matches
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
17namespace panzer
18{
19
21PointDescriptor(const std::string & type,const Teuchos::RCP<PointGenerator> & generator)
22{
23 setup(type,generator);
24}
25
26void
28setup(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
41std::size_t
42std::hash<panzer::PointDescriptor>::operator()(const panzer::PointDescriptor& desc) const
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}
std::size_t _key
Unique key associated with integrator.
PointDescriptor()=delete
Default constructor, no version.
Teuchos::RCP< PointGenerator > _generator
PointGenerator object to build the points.
std::string _type
Type string.
void setup(const std::string &type, const Teuchos::RCP< PointGenerator > &generator)
Setup the point descriptor. Protected and used by constructors.
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)