Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_BasisInformation.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 
15 #include <sstream>
16 
17 namespace panzer {
18 
20 BasisInformation(const std::string & in_basis_type,
21  const int in_basis_order,
22  const shards::CellTopology & cell_topo) :
23  topology_(cell_topo)
24 {
25  // Support for deprecated basis descriptions
26  std::string basis_type = in_basis_type;
27  int basis_order = in_basis_order;
28 
29  if (basis_type=="Q1" || basis_type=="T1") {
30  basis_type = "HGrad";
31  basis_order = 1;
32  }
33  else if (basis_type == "Q2" || basis_type=="T2") {
34  basis_type = "HGrad";
35  basis_order = 2;
36  }
37  else if (basis_type == "TEdge1" || basis_type=="QEdge1") {
38  basis_type = "HCurl";
39  basis_order = 1;
40  }
41  else if(basis_type == "Const") {
42  basis_type = "Const";
43  basis_order = 0;
44  }
45  // End deprecated basis support
46 
47  basis_type_ = basis_type;
48  basis_order_ = basis_order;
49 
50  if( basis_type_ == "HGrad")
52  else if(basis_type_=="HCurl")
54  else if(basis_type_=="HDiv")
56  else if(basis_type_=="Const")
58  else { TEUCHOS_TEST_FOR_EXCEPTION(true,std::invalid_argument,
59  "BasisInformation::initializeIntrospection - Invalid basis name \""
60  << basis_type_ << "\""); }
61 }
62 
63 }
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
BasisInformation(const std::string &basis_type, const int basis_order, const shards::CellTopology &cell_topo)