Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_STK_ExodusReaderFactory.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_STK_ExodusReaderFactory_hpp__
12 #define Panzer_STK_ExodusReaderFactory_hpp__
13 
14 #include <string>
15 
16 #include "PanzerAdaptersSTK_config.hpp"
18 
19 #ifdef PANZER_HAVE_IOSS
20 
21 #include <stk_io/StkMeshIoBroker.hpp>
22 
23 namespace panzer_stk {
24 
25 class STK_Interface;
26 
40  int getMeshDimension(const std::string & meshStr,stk::ParallelMachine parallelMach, const std::string & typeStr = "Exodus");
41 
42  std::string fileTypeToIOSSType(const std::string & fileType);
43 
54 class STK_ExodusReaderFactory : public STK_MeshFactory {
55 public:
56 
57  STK_ExodusReaderFactory();
58 
59 
65  STK_ExodusReaderFactory(const std::string & fileName, const int restartIndex=0);
66 
75  virtual Teuchos::RCP<STK_Interface> buildMesh(stk::ParallelMachine parallelMach) const;
76 
81  virtual Teuchos::RCP<STK_Interface> buildUncommitedMesh(stk::ParallelMachine parallelMach) const;
82 
85  virtual void completeMeshConstruction(STK_Interface & mesh,stk::ParallelMachine parallelMach) const;
86 
88  void setParameterList(const Teuchos::RCP<Teuchos::ParameterList> & paramList);
89 
91  Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const;
92 
94  const std::string & getFileName() const
95  { return fileName_; }
96 
97 protected:
98 
99  void registerElementBlocks(STK_Interface & mesh,stk::io::StkMeshIoBroker & meshData) const;
100  void registerSidesets(STK_Interface & mesh) const;
101  void registerNodesets(STK_Interface & mesh) const;
102  void registerEdgeBlocks(STK_Interface & mesh,stk::io::StkMeshIoBroker & meshData) const;
103  void registerFaceBlocks(STK_Interface & mesh,stk::io::StkMeshIoBroker & meshData) const;
104 
105  void addEdgeBlocks(STK_Interface & mesh) const;
106  void addFaceBlocks(STK_Interface & mesh) const;
107 
108  std::string mkBlockName(std::string base, std::string topo_name) const;
109  void createUniqueEdgeTopologyMap(STK_Interface & mesh, const stk::mesh::Part *elemBlockPart) const;
110  void createUniqueFaceTopologyMap(STK_Interface & mesh, const stk::mesh::Part *elemBlockPart) const;
111 
112  void buildMetaData(stk::ParallelMachine parallelMach, STK_Interface & mesh) const;
113 
114  bool doPerceptRefinement() const;
115 
116  std::string fileName_;
117  std::string fileType_;
118  int restartIndex_;
119 
120  /* The ExodusReaderFactory creates one edge/face block for each
121  * unique edge/face topology in the mesh. There are a few
122  * situations where it's desirable to have a list of unique
123  * topologies for each element block. Instead of creating it
124  * on the fly, they are created and saved when the element
125  * blocks are added to the STK_Interface in
126  * registerElementBlocks().
127  */
128  mutable std::map<std::string,std::vector<stk::topology>> elemBlockUniqueEdgeTopologies_;
129  mutable std::map<std::string,std::vector<stk::topology>> elemBlockUniqueFaceTopologies_;
130 
131 private:
132 
134  bool userMeshScaling_;
135 
137  bool keepPerceptData_;
138 
140  bool keepPerceptParentElements_;
141 
143  std::string rebalancing_;
144 
146  double meshScaleFactor_;
147 
149  int levelsOfRefinement_;
150 
152  bool createEdgeBlocks_;
153 
155  bool createFaceBlocks_;
156 
157  std::string geometryName_;
158 };
159 
160 }
161 
162 #endif
163 #endif