00001 //*****************************************************************// 00002 // Albany 2.0: Copyright 2012 Sandia Corporation // 00003 // This Software is released under the BSD license detailed // 00004 // in the file "license.txt" in the top-level Albany directory // 00005 //*****************************************************************// 00006 00007 #ifndef ALBANY_ABSTRACTSTKMESHSTRUCT_HPP 00008 #define ALBANY_ABSTRACTSTKMESHSTRUCT_HPP 00009 00010 #include <vector> 00011 #include <fstream> 00012 00013 #include "Albany_AbstractMeshStruct.hpp" 00014 00015 #include "Albany_AbstractSTKFieldContainer.hpp" 00016 00017 // Start of STK stuff 00018 #include <stk_util/parallel/Parallel.hpp> 00019 #include <stk_mesh/base/Types.hpp> 00020 #include <stk_mesh/fem/FEMMetaData.hpp> 00021 #include <stk_mesh/base/BulkData.hpp> 00022 00023 #include "Teuchos_ScalarTraits.hpp" 00024 00025 namespace Albany { 00027 struct PeriodicBCStruct { 00028 PeriodicBCStruct() 00029 {periodic[0]=false; periodic[1]=false; periodic[2]=false; 00030 scale[0]=1.0; scale[1]=1.0; scale[2]=1.0; }; 00031 bool periodic[3]; 00032 double scale[3]; 00033 }; 00034 00035 struct AbstractSTKMeshStruct : public AbstractMeshStruct { 00036 00037 virtual ~AbstractSTKMeshStruct(){} 00038 00039 public: 00040 00041 virtual void setFieldAndBulkData( 00042 const Teuchos::RCP<const Epetra_Comm>& comm, 00043 const Teuchos::RCP<Teuchos::ParameterList>& params, 00044 const unsigned int neq_, 00045 const AbstractFieldContainer::FieldContainerRequirements& req, 00046 const Teuchos::RCP<Albany::StateInfoStruct>& sis, 00047 const unsigned int worksetSize) {}; 00048 00049 msType meshSpecsType(){ return STK_MS; } 00050 00051 stk::mesh::fem::FEMMetaData* metaData; 00052 stk::mesh::BulkData* bulkData; 00053 00054 std::map<int, stk::mesh::Part*> partVec; //Element blocks 00055 std::map<std::string, stk::mesh::Part*> nsPartVec; //Node Sets 00056 std::map<std::string, stk::mesh::Part*> ssPartVec; //Side Sets 00057 00058 Teuchos::RCP<Albany::AbstractSTKFieldContainer> getFieldContainer(){return fieldContainer; } 00059 AbstractSTKFieldContainer::VectorFieldType* getCoordinatesField(){ return fieldContainer->getCoordinatesField(); } 00060 00061 int numDim; 00062 int neq; 00063 bool interleavedOrdering; 00064 00065 bool exoOutput; 00066 std::string exoOutFile; 00067 int exoOutputInterval; 00068 std::string cdfOutFile; 00069 bool cdfOutput; 00070 unsigned nLat; 00071 unsigned nLon; 00072 int cdfOutputInterval; 00073 00074 bool transferSolutionToCoords; 00075 00076 // Solution history 00077 virtual int getSolutionFieldHistoryDepth() const { return 0; } // No history by default 00078 virtual double getSolutionFieldHistoryStamp(int step) const { return Teuchos::ScalarTraits<double>::nan(); } // Dummy value 00079 virtual void loadSolutionFieldHistory(int step) { /* Does nothing by default */ } 00080 00082 virtual bool hasRestartSolution() const = 0; 00083 00085 virtual double restartDataTime() const = 0; 00086 00087 virtual bool useCompositeTet() = 0; 00088 00089 //Flag for transforming STK mesh; currently only needed for FELIX problems 00090 std::string transformType; 00091 //alpha and L are parameters read in from ParameterList for FELIX problems 00092 double felixAlpha; 00093 double felixL; 00094 00095 bool contigIDs; //boolean specifying if ascii mesh has contiguous IDs; only used for ascii meshes on 1 processor 00096 00097 //boolean flag for writing coordinates to matrix market file (e.g., for ML analysis) 00098 bool writeCoordsToMMFile; 00099 00100 // Info to map element block to physics set 00101 bool allElementBlocksHaveSamePhysics; 00102 std::map<std::string, int> ebNameToIndex; 00103 00104 // Info for periodic BCs -- only for hand-coded STK meshes 00105 struct PeriodicBCStruct PBCStruct; 00106 00107 protected: 00108 00109 Teuchos::RCP<Albany::AbstractSTKFieldContainer> fieldContainer; 00110 00111 }; 00112 } 00113 00114 #endif // ALBANY_ABSTRACTSTKMESHSTRUCT_HPP