Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_FieldLibrary.hpp
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 
11 #ifndef __Panzer_FieldLibrary_hpp__
12 #define __Panzer_FieldLibrary_hpp__
13 
14 #include "PanzerDiscFE_config.hpp"
15 
16 #include "Teuchos_RCP.hpp"
17 
18 #include "Panzer_BasisIRLayout.hpp"
19 #include "Panzer_PointRule.hpp"
20 #include "Panzer_PureBasis.hpp"
21 
22 #include <vector>
23 
24 namespace panzer {
25 
27 public:
28  virtual ~FieldLibraryBase() = 0;
29 
31  virtual Teuchos::RCP<const panzer::PureBasis> lookupBasis(const std::string & fieldName) const = 0;
32 
34  virtual void uniqueBases(std::vector<Teuchos::RCP<const panzer::PureBasis> > & bases) const = 0;
35 
37  virtual void basisPairs(std::vector<std::pair<std::string,Teuchos::RCP<const panzer::PureBasis> > > & bases) const = 0;
38 
42  virtual void print(std::ostream & os) const = 0;
43 };
44 
46 
50 public:
53  void addFieldAndLayout(const std::string & fieldName,
55 
57  void uniqueBases(std::vector<Teuchos::RCP<const panzer::PureBasis> > & bases) const;
58 
60  virtual Teuchos::RCP<const panzer::PureBasis> lookupBasis(const std::string & fieldName) const;
61 
63  Teuchos::RCP<panzer::BasisIRLayout> lookupLayout(const std::string & fieldName) const;
64 
68  virtual void print(std::ostream & os) const;
69 
71  virtual void basisPairs(std::vector<std::pair<std::string,Teuchos::RCP<const panzer::PureBasis> > > & bases) const;
72 
73 private:
74 
76  std::map<std::string,Teuchos::RCP<panzer::BasisIRLayout> > fieldToLayout_;
77  std::map<std::string,Teuchos::RCP<const panzer::PureBasis> > basisNameToPointer_; // to satisfy uniuqeBases interface
78 
79 };
80 
89 public:
90 
92  virtual Teuchos::RCP<const panzer::PureBasis> lookupBasis(const std::string & fieldName) const;
93 
95  void uniqueBases(std::vector<Teuchos::RCP<const panzer::PureBasis> > & bases) const;
96 
99  void addFieldAndBasis(const std::string & fieldName,
100  const Teuchos::RCP<panzer::PureBasis> & basis);
101 
107 
111  virtual void print(std::ostream & os) const;
112 
114  virtual void basisPairs(std::vector<std::pair<std::string,Teuchos::RCP<const panzer::PureBasis> > > & bases) const;
115 
116 private:
117 
119  std::map<std::string,Teuchos::RCP<panzer::PureBasis> > fieldToBasis_;
120  std::map<std::string,Teuchos::RCP<const panzer::PureBasis> > basisNameToPointer_; // to satisfy uniuqeBases interface
121 };
122 
123 inline std::ostream & operator<<(std::ostream & os,const FieldLibraryBase & flb)
124 {
125  flb.print(os);
126  return os;
127 }
128 
129 }
130 
131 #endif
Teuchos::RCP< panzer::BasisIRLayout > lookupLayout(const std::string &fieldName) const
Get the basis associated with a particular field.
virtual void basisPairs(std::vector< std::pair< std::string, Teuchos::RCP< const panzer::PureBasis > > > &bases) const
Get vector of unique bases contained in this field library.
virtual void uniqueBases(std::vector< Teuchos::RCP< const panzer::PureBasis > > &bases) const =0
Get vector of unique bases contained in this field library.
virtual Teuchos::RCP< const panzer::PureBasis > lookupBasis(const std::string &fieldName) const =0
Get the basis associated with a particular field.
void uniqueBases(std::vector< Teuchos::RCP< const panzer::PureBasis > > &bases) const
Get vector of unique bases contained in this field library.
void uniqueBases(std::vector< Teuchos::RCP< const panzer::PureBasis > > &bases) const
Get vector of unique bases contained in this field library.
virtual void print(std::ostream &os) const
std::map< std::string, Teuchos::RCP< panzer::PureBasis > > fieldToBasis_
Basic mapped storage.
Teuchos::RCP< const FieldLayoutLibrary > buildFieldLayoutLibrary(panzer::PointRule &ir) const
virtual Teuchos::RCP< const panzer::PureBasis > lookupBasis(const std::string &fieldName) const
Get the basis associated with a particular field.
void addFieldAndLayout(const std::string &fieldName, const Teuchos::RCP< panzer::BasisIRLayout > &basis)
std::ostream & operator<<(std::ostream &os, const AssemblyEngineInArgs &in)
std::map< std::string, Teuchos::RCP< const panzer::PureBasis > > basisNameToPointer_
std::map< std::string, Teuchos::RCP< panzer::BasisIRLayout > > fieldToLayout_
Basic mapped storage.
virtual void basisPairs(std::vector< std::pair< std::string, Teuchos::RCP< const panzer::PureBasis > > > &bases) const =0
Get vector of unique bases contained in this field library.
virtual void print(std::ostream &os) const =0
virtual Teuchos::RCP< const panzer::PureBasis > lookupBasis(const std::string &fieldName) const
Get the basis associated with a particular field.
std::map< std::string, Teuchos::RCP< const panzer::PureBasis > > basisNameToPointer_
void addFieldAndBasis(const std::string &fieldName, const Teuchos::RCP< panzer::PureBasis > &basis)
virtual void basisPairs(std::vector< std::pair< std::string, Teuchos::RCP< const panzer::PureBasis > > > &bases) const
Get vector of unique bases contained in this field library.
virtual void print(std::ostream &os) const