00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef U2D_UMESH2D_OUTPUT_H
00025 #define U2D_UMESH2D_OUTPUT_H
00026
00027 #include <string>
00028
00029 #include "u2d_core.h"
00030 #include "u2d_file_output.h"
00031 #include "exceptions.h"
00032
00033 #define FORMAT_UMESH2D 1
00034 #define FORMAT_UMESH2D_FE 2
00035 #define FORMAT_UMESH2D_FV 3
00036
00037 #define DIR_SEPARATOR '/'
00038
00039 using std::string;
00040
00041 class u2d_Umesh2d_Output : public u2d_File_Output {
00042 public:
00043
00044 void output() throw (u2d_IO_Exception&);
00045 void set_filename(string filename) throw (u2d_Parse_Error_Exception &);
00046 string get_filename();
00047 void set_format(int format);
00048
00049
00050 u2d_Umesh2d_Output();
00051
00052
00053 void select_prim_list(Primitive *first, Primitive *last, int prim_number, int vertex_n);
00054
00055
00056 void set_steiners(steiner *steiners_, int number);
00057 void set_backgrids(backgrid *backgrid_, int number);
00058
00059 private:
00060
00061 int output_format;
00062
00063 steiner *steiners;
00064 backgrid *backgrids;
00065 int steiner_n;
00066 int backgrid_n;
00067
00068
00069 Primitive *firstprimitive;
00070 Primitive *lastprimitive;
00071 int elements;
00072 int vertexs;
00073
00074
00075 inline void printhash(FILE *output);
00076 inline void printformat(FILE *output, int format);
00077 inline void printgeom(FILE *output);
00078 inline void printtopo(FILE *output);
00079 inline void printnvne(FILE *output);
00080 void printverelem(FILE *output);
00081 inline void printish(FILE *output);
00082 inline void printenbvev(FILE *output);
00083 void printprimg(FILE *output, Primitive *curprim);
00084 void printprimd(FILE *outptu, Primitive *curprim);
00085 void printbegin(FILE *output, int id);
00086 void printbegin(FILE *output, int id, char *name);
00087 inline void printend(FILE *output);
00088 void printpriminfo(FILE *output);
00089 void printprimdata(FILE *output);
00090
00091
00092 void output_boundary_file() throw (u2d_IO_Exception &);
00093 void output_domain_file() throw (u2d_IO_Exception &);
00094 void open_boundary_file() throw (u2d_IO_Exception &);
00095 void open_domain_file() throw (u2d_IO_Exception &);
00096 string project_name;
00097 string boundary_filename;
00098 string domain_filename;
00099 void set_boundary_filename();
00100 void set_domain_filename();
00101 FILE *boundary_file;
00102 FILE *domain_file;
00103
00104
00105
00106 void add_boundary(char *buffer);
00107
00108 void add_domain(char *buffer);
00109 };
00110
00111
00112 #endif // U2D_UMESH2D_OUTPUT_H