F5Bchart.h

00001 /*
00002  $Id: F5Bchart.h,v 1.23 2008/03/19 21:21:43 werner Exp $
00003 */
00004 
00005 #ifndef __F5_F5Bchart_H
00006 #define __F5_F5Bchart_H
00007 
00008 #include <F5/hdf5inc.h>
00009 #include <F5/F5defs.h>
00010 #include <F5/F5types.h>
00011 
00012 #include "F5WinDLLApi.h"
00013 
00014 #ifdef  __cplusplus
00015 extern "C"
00016 {
00017 #endif
00018 
00019 #if defined(_WINDOWS) || defined(_WIN32) || defined(__MSC_VER__)
00020 #define H5Tname_free(x)
00021 #else
00022 #define H5Tname_free(x) free(x)
00023 #endif
00024 
00031 struct  _F5_ChartPrecisionTypes
00032 {
00034         hid_t   Point_hid_t,
00035                 
00037                 Vector_hid_t,
00038 
00040                 Covector_hid_t,
00041 
00043                 Bivector_hid_t,
00044 
00046                 Bicovector_hid_t,
00047 
00048                 Pseudoscalar_hid_t,
00049                 
00050                 Pseudocoscalar_hid_t,
00051                 
00052                 Metric_hid_t,
00053 
00054                 Cometric_hid_t;
00055 };
00056 
00057 typedef struct _F5_ChartPrecisionTypes F5_ChartPrecisionTypes;
00058 
00063 F5_API void F5Bchart_init_tangential_types(F5_ChartPrecisionTypes*H5Types, 
00064                                            const char*coordnames[],
00065                                            int dimension,
00066                                            hid_t coord_type);
00067 
00068         
00069 F5_API void F5Bchart_add_tangential_types(F5_ChartPrecisionTypes*H5Types, 
00070                                           const char*coordnames[],
00071                                           int dimension,
00072                                           hid_t coord_type);
00073 
00074 F5_API  void F5B_delete_tangential_types(F5_ChartPrecisionTypes*IDs);
00075 
00076 F5_API void F5Bchart_read_tangential_types(F5_ChartPrecisionTypes*H5Types,
00077                                            hid_t        location);
00078 
00079         
00085 typedef struct 
00086 {
00088         const char*domain_name;
00089 
00090         unsigned  refs;                 
00117         int     perm_vector[FIBER_MAX_RANK];
00118         int     cell_dimensionality;
00119 
00120         F5_ChartPrecisionTypes
00121 /*              HalfPrecision, */
00122                 SinglePrecision,
00123                 DoublePrecision;
00124 /*              QuadPrecision;  */
00125 
00130         F5Ttensor_t**TensorTypes;
00131 
00132 }
00133         ChartDomain_IDs;
00134 
00135 
00136 F5_API void F5Binsert_tensor_type(ChartDomain_IDs*CD, F5Ttensor_t*);
00137 F5_API F5Ttensor_t*F5Bget_tensor_type_byname(ChartDomain_IDs*CD, const char*name);
00138 
00139 
00140         
00145 typedef ChartDomain_IDs*(*new_global_chart_f)();
00146 
00155 F5_API ChartDomain_IDs*F5B_new_global_domain(const char*coordnames[],
00156                                              int dimension,
00157                                              const char*name,
00158                                              const int perm_vector[],
00159                                              int cell_dimensionality,
00160                                              hid_t SinglePrecisionType,
00161                                              hid_t DoublePrecisionType
00162         );
00163 
00164 
00178 F5_API ChartDomain_IDs*F5B_new_global_float_chart(const char*coordnames[],
00179                                                   int dimension,
00180                                                   const char*name,
00181                                                   const int perm_vector[FIBER_MAX_RANK] );
00182 
00188 F5_API ChartDomain_IDs*F5B_new_global_int_domain(const char*coordnames[],
00189                                                  int dimension,
00190                                                  const char*name,
00191                                                  const int perm_vector[FIBER_MAX_RANK],
00192                                                  int cell_dimensionality);
00193 
00194 F5_API ChartDomain_IDs*F5B_new_global_fractional_domain(const char*coordnames[],
00195                                                         int dimension,
00196                                                         const char*name,
00197                                                         const int perm_vector[],
00198                                                         int cell_dimensionality);
00199 
00200         
00201 /*F5_API ChartDomain_IDs*F5Bcopy_chart(ChartDomain_IDs*oldchart, const char*newname); */
00202 
00210 F5_API ChartDomain_IDs*F5Bcopy_chart_domain(const ChartDomain_IDs*IDs);
00211 
00212 
00218 F5_API int      F5Bget_chart_dims(const ChartDomain_IDs*IDs);
00219         
00220 #define F5_FORTRAN_ORDER        ((int*)(0))
00221 #define F5_C_ORDER              ((int*)(-1))
00222 
00240 F5_API hsize_t*F5B_permute_dimensions(hsize_t*target_dims,
00241                                       int rank,
00242                                       const hsize_t*source_dims,
00243                                       int perm_vector[FIBER_MAX_RANK],
00244                                       int perm_vector_size);
00245 
00251 F5_API const int*F5B_fortran_permute_vector();
00252         
00257 F5_API void F5B_delete_global_chart(ChartDomain_IDs*ID);
00258 
00259 F5_API void F5Bincrement_domain_refs(ChartDomain_IDs*ChartDomain);
00260         
00261 F5_API ChartDomain_IDs*F5B_save_global_chart(const ChartDomain_IDs*IDs, hid_t Domain_hid);
00262 F5_API ChartDomain_IDs*F5B_read_global_chart(hid_t ChartsID, const char*name);
00263 
00264 F5_API ChartDomain_IDs*F5B_new_global_cartesian_chart3D();
00265         
00266 #ifdef  __cplusplus
00267 }    /* extern "C" */
00268 #endif
00269 
00270 #endif  /* __F5_F5Bchart_H */
00271