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