moab
WriteAns.hpp
Go to the documentation of this file.
00001 
00016 //-------------------------------------------------------------------------
00017 // Filename      : WriteTEMPLATE.hpp
00018 //
00019 // Purpose       : ExodusII writer
00020 //
00021 // Special Notes : Lots of code taken from verde implementation
00022 //
00023 // Creator       : Corey Ernst 
00024 //
00025 // Date          : 8/02
00026 //
00027 // Owner         : Corey Ernst 
00028 //-------------------------------------------------------------------------
00029 
00030 #ifndef WRITEANS_HPP
00031 #define WRITEANS_HPP
00032 
00033 #ifndef IS_BUILDING_MB
00034 #error "WriteAns.hpp isn't supposed to be included into an application"
00035 #endif
00036 
00037 #include <string>
00038 
00039 #include "moab/Forward.hpp"
00040 #include "moab/Range.hpp"
00041 #include "moab/ExoIIInterface.hpp"
00042 #include "moab/WriterIface.hpp"
00043 
00044 namespace moab {
00045 
00046 class WriteUtilIface;
00047 
00048 class WriteAns : public WriterIface
00049 {
00050  
00051 public:
00052 
00054    WriteAns(Interface *impl);
00055 
00057   virtual ~WriteAns();
00058   
00059   static WriterIface* factory( Interface* );
00060 
00062   ErrorCode write_file(const char *file_name,
00063                          const bool overwrite,
00064                          const FileOptions& opts,
00065                           const EntityHandle *output_list,
00066                           const int num_sets,
00067                           const std::vector<std::string>& qa_list,
00068                           const Tag* tag_list = NULL,
00069                           int num_tags = 0,
00070                           int export_dimension = 3);
00071   
00074   struct MaterialSetData
00075   {
00076     int id;
00077     int number_elements;
00078     int number_nodes_per_element;
00079     int number_attributes;
00080     ExoIIElementType element_type;
00081     EntityType moab_type;
00082     Range *elements;
00083   };
00084 
00087   struct DirichletSetData
00088   {
00089     int id;
00090     int number_nodes;
00091     std::vector< EntityHandle > nodes;
00092     std::vector< double > node_dist_factors;
00093   
00094   };
00095 
00098   struct NeumannSetData
00099   {
00100     int id;
00101     int number_elements;
00102     std::vector<EntityHandle> elements;
00103     std::vector<int> side_numbers;
00104     EntityHandle mesh_set_handle;
00105   };
00106 
00107 
00108 protected:
00109 
00111   //int number_dimensions();
00112 
00114   //ErrorCode open_file(const char *filename);
00115 
00117   class MeshInfo
00118   {
00119   public:
00120     unsigned int num_dim;
00121     unsigned int num_nodes;
00122     unsigned int num_elements;
00123     unsigned int num_matsets;
00124     unsigned int num_dirsets;
00125     unsigned int num_neusets;
00126     Range nodes;
00127 
00128     MeshInfo() 
00129         : num_dim(0), num_nodes(0), num_elements(0), num_matsets(0), 
00130           num_dirsets(0), num_neusets(0)
00131       {}
00132     
00133   };
00134   
00135 private:
00136 
00138   Interface *mbImpl;
00139   //WriteUtilIface* mWriteIface;
00140   
00142   std::string fileName;
00143 
00145   EntityHandle mCurrentMeshHandle;
00146 
00149   Tag mMaterialSetTag;
00150   Tag mDirichletSetTag;
00151   Tag mNeumannSetTag;
00152   Tag mGlobalIdTag;
00153   Tag mMatSetIdTag;
00154   
00155   ErrorCode write_nodes(const int num_nodes, const Range& nodes, 
00156                           const int dimension, const char *file_name );
00157   
00158 };
00159 
00160 } // namespace moab
00161 
00162 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines