Panzer Version of the Day
Loading...
Searching...
No Matches
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
23namespace panzer_stk {
24
25class STK_Interface;
26
40 int getMeshDimension(const std::string & meshStr,stk::ParallelMachine parallelMach, const std::string & typeStr = "Exodus");
41
43 std::string fileTypeToIOSSType(const std::string & fileType);
44
55class STK_ExodusReaderFactory : public STK_MeshFactory {
56public:
57
59 STK_ExodusReaderFactory();
60
61
67 STK_ExodusReaderFactory(const std::string & fileName, const int restartIndex=0);
68
77 virtual Teuchos::RCP<STK_Interface> buildMesh(stk::ParallelMachine parallelMach) const;
78
83 virtual Teuchos::RCP<STK_Interface> buildUncommitedMesh(stk::ParallelMachine parallelMach) const;
84
87 virtual void completeMeshConstruction(STK_Interface & mesh,stk::ParallelMachine parallelMach) const;
88
90 void setParameterList(const Teuchos::RCP<Teuchos::ParameterList> & paramList);
91
93 Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const;
94
96 const std::string & getFileName() const
97 { return fileName_; }
98
99protected:
100
101 void registerElementBlocks(STK_Interface & mesh,stk::io::StkMeshIoBroker & meshData) const;
102 void registerSidesets(STK_Interface & mesh) const;
103 void registerNodesets(STK_Interface & mesh) const;
104 void registerEdgeBlocks(STK_Interface & mesh,stk::io::StkMeshIoBroker & meshData) const;
105 void registerFaceBlocks(STK_Interface & mesh,stk::io::StkMeshIoBroker & meshData) const;
106
107 void addEdgeBlocks(STK_Interface & mesh) const;
108 void addFaceBlocks(STK_Interface & mesh) const;
109
110 std::string mkBlockName(std::string base, std::string topo_name) const;
111 void createUniqueEdgeTopologyMap(STK_Interface & mesh, const stk::mesh::Part *elemBlockPart) const;
112 void createUniqueFaceTopologyMap(STK_Interface & mesh, const stk::mesh::Part *elemBlockPart) const;
113
114 void buildMetaData(stk::ParallelMachine parallelMach, STK_Interface & mesh) const;
115
116 bool doPerceptRefinement() const;
117
118 std::string fileName_;
119 std::string fileType_;
120 int restartIndex_;
121
122 /* The ExodusReaderFactory creates one edge/face block for each
123 * unique edge/face topology in the mesh. There are a few
124 * situations where it's desirable to have a list of unique
125 * topologies for each element block. Instead of creating it
126 * on the fly, they are created and saved when the element
127 * blocks are added to the STK_Interface in
128 * registerElementBlocks().
129 */
130 mutable std::map<std::string,std::vector<stk::topology>> elemBlockUniqueEdgeTopologies_;
131 mutable std::map<std::string,std::vector<stk::topology>> elemBlockUniqueFaceTopologies_;
132
133private:
134
136 bool userMeshScaling_;
137
139 bool keepPerceptData_;
140
142 bool keepPerceptParentElements_;
143
145 std::string rebalancing_;
146
148 double meshScaleFactor_;
149
151 int levelsOfRefinement_;
152
154 bool createEdgeBlocks_;
155
157 bool createFaceBlocks_;
158
159 std::string geometryName_;
160};
161
162}
163
164#endif
165#endif