Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_ElemFieldPattern.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 "Teuchos_Assert.hpp"
14 #include "Shards_CellTopology.hpp"
15 
16 namespace panzer {
17 
18 ElemFieldPattern::ElemFieldPattern(const shards::CellTopology & ct)
19 {
20  setCellTopology(ct);
21 }
22 
23 void ElemFieldPattern::setCellTopology(const shards::CellTopology & ct)
24 {
25  cellTopo_ = ct;
26 
27  // allocate the space and setup the indices
28  ElemIndices_.clear();
29  ElemIndices_.resize(1);
30  for(std::size_t n=0;n<ElemIndices_.size();n++)
31  ElemIndices_[n].push_back(n);
32 }
33 
35 {
36  const shards::CellTopology ct = getCellTopology();
37  return ct.getSubcellCount(dim);
38 }
39 
40 const std::vector<int> & ElemFieldPattern::getSubcellIndices(int dim,int cellIndex) const
41 {
42  if(dim==getDimension())
43  return ElemIndices_[cellIndex];
44 
45  // only Elems
46  return empty_;
47 }
48 
49 void ElemFieldPattern::getSubcellClosureIndices(int /* dim */, int /* cellIndex */, std::vector<int>& /* indices */) const
50 {
51  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
52  "ElemFieldPattern::getSubcellClosureIndices should not be called");
53 }
54 
56 {
57  const shards::CellTopology ct = getCellTopology();
58  return ct.getDimension();
59 }
60 
61 }
virtual int getSubcellCount(int dim) const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual void getSubcellClosureIndices(int dim, int cellIndex, std::vector< int > &indices) const
void setCellTopology(const shards::CellTopology &ct)
Set the cell topology for this field pattern.
virtual shards::CellTopology getCellTopology() const
virtual const std::vector< int > & getSubcellIndices(int dim, int cellIndex) const
std::vector< std::vector< int > > ElemIndices_