Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_EdgeFieldPattern.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
16namespace panzer {
17
18EdgeFieldPattern::EdgeFieldPattern(const shards::CellTopology & ct)
19{
21}
22
23void EdgeFieldPattern::setCellTopology(const shards::CellTopology & ct)
24{
25 cellTopo_ = ct;
26
27 // allocate the space and setup the indices
28 edgeIndices_.clear();
29 // edgeIndices_.resize(cellTopo_.getEdgeCount());
30 edgeIndices_.resize(cellTopo_.getSubcellCount(1));
31 for(std::size_t n=0;n<edgeIndices_.size();n++)
32 edgeIndices_[n].push_back(n);
33}
34
36{
37 const shards::CellTopology ct = getCellTopology();
38 return ct.getSubcellCount(dim);
39}
40
41const std::vector<int> & EdgeFieldPattern::getSubcellIndices(int dim,int cellIndex) const
42{
43 if(dim==1)
44 return edgeIndices_[cellIndex];
45
46 // only edges
47 return empty_;
48}
49
50void EdgeFieldPattern::getSubcellClosureIndices(int /* dim */, int /* cellIndex */, std::vector<int>& /* indices */) const
51{
52 TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
53 "EdgeFieldPattern::getSubcellClosureIndices should not be called");
54}
55
57{
58 const shards::CellTopology ct = getCellTopology();
59 return ct.getDimension();
60}
61
62}
std::vector< std::vector< int > > edgeIndices_
virtual int getSubcellCount(int dim) const
virtual void getSubcellClosureIndices(int dim, int cellIndex, std::vector< int > &indices) const
virtual shards::CellTopology getCellTopology() 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.