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