00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef INC_FINLEY_MESH
00016 #define INC_FINLEY_MESH
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #include "Finley.h"
00060 #include "NodeFile.h"
00061 #include "ElementFile.h"
00062 #include "TagMap.h"
00063 #include "Util.h"
00064 #include "paso/SystemMatrixPattern.h"
00065 #include "escript/DataC.h"
00066
00067 #ifdef PASO_MPI
00068 #include "paso/Paso_MPI.h"
00069 #endif
00070
00071
00072
00073
00074
00075 struct Finley_Mesh {
00076 char* Name;
00077 index_t order;
00078 index_t reduced_order;
00079 dim_t reference_counter;
00080 Finley_NodeFile* Nodes;
00081 Finley_ElementFile* Elements;
00082 Finley_ElementFile* FaceElements;
00083 Finley_ElementFile* ContactElements;
00084 Finley_ElementFile* Points;
00085 Finley_TagMap* TagMap;
00086
00087
00088
00089 Paso_SystemMatrixPattern *FullFullPattern;
00090 Paso_SystemMatrixPattern *FullReducedPattern;
00091 Paso_SystemMatrixPattern *ReducedFullPattern;
00092 Paso_SystemMatrixPattern *ReducedReducedPattern;
00093 Paso_MPIInfo *MPIInfo;
00094 };
00095
00096 typedef struct Finley_Mesh Finley_Mesh;
00097
00098
00099
00100 struct Finley_Mesh_findMatchingFaces_center{
00101 index_t refId;
00102 double x[MAX_numDim];
00103 };
00104 typedef struct Finley_Mesh_findMatchingFaces_center Finley_Mesh_findMatchingFaces_center;
00105
00106
00107
00108
00109 Finley_Mesh* Finley_Mesh_alloc(char* name,dim_t numDim, index_t order, index_t reduced_order, Paso_MPIInfo *mpi_info);
00110 Finley_Mesh* Finley_Mesh_reference(Finley_Mesh*);
00111 dim_t Finley_Mesh_getDim(Finley_Mesh*);
00112 void Finley_Mesh_free(Finley_Mesh*);
00113
00114 void Finley_Mesh_addTagMap(Finley_Mesh *mesh_p,const char* name, index_t tag_key);
00115 index_t Finley_Mesh_getTag(Finley_Mesh *mesh_p,const char* name);
00116 bool_t Finley_Mesh_isValidTagName(Finley_Mesh *mesh_p,const char* name);
00117 void Finley_Mesh_distributeByRankOfDOF(Finley_Mesh* in, dim_t *distribution);
00118 Paso_SystemMatrixPattern* Finley_getPattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order);
00119 Paso_SystemMatrixPattern* Finley_makePattern(Finley_Mesh *mesh,bool_t reduce_row_order, bool_t reduce_col_order);
00120 void Finley_Mesh_write(Finley_Mesh*,char*);
00121 void Finley_Mesh_dump(Finley_Mesh *in,char* fname);
00122 void Finley_PrintMesh_Info(Finley_Mesh *, bool_t);
00123 Finley_Mesh* Finley_Mesh_load(char* fname);
00124 Finley_Mesh* Finley_Mesh_read(char*,index_t, index_t, bool_t);
00125 Finley_Mesh* Finley_Mesh_read_MPI(char*,index_t, index_t, bool_t);
00126 Finley_Mesh* Finley_Mesh_readGmsh(char*,index_t, index_t, index_t, bool_t);
00127 void Finley_Mesh_setCoordinates(Finley_Mesh*,escriptDataC*);
00128 void Finley_Mesh_setElements(Finley_Mesh* self,Finley_ElementFile *elements);
00129 void Finley_Mesh_setFaceElements(Finley_Mesh* self,Finley_ElementFile *elements);
00130 void Finley_Mesh_setContactElements(Finley_Mesh* self,Finley_ElementFile *elements);
00131 void Finley_Mesh_setPoints(Finley_Mesh* self,Finley_ElementFile *elements);
00132 void Finley_Mesh_optimizeDOFDistribution(Finley_Mesh* in,dim_t *distribution);
00133 void Finley_Mesh_prepare(Finley_Mesh* in, bool_t optimize);
00134 void Finley_Mesh_createColoring(Finley_Mesh* in, index_t *node_localDOF_map);
00135 void Finley_Mesh_optimizeElementOrdering(Finley_Mesh* in);
00136 void Finley_Mesh_resolveNodeIds(Finley_Mesh*);
00137 void Finley_Mesh_createMappings(Finley_Mesh* in, index_t *dof_distribution, index_t *node_distribution);
00138 void Finley_Mesh_createNodeFileMappings(Finley_Mesh* in, dim_t numReducedNodes, index_t* indexReducedNodes, index_t* dof_first_component, index_t* nodes_first_component);
00139 void Finley_Mesh_markDOFsConnectedToRange(index_t* mask, index_t offset, index_t marker,index_t firstDOF,index_t lastDOF,Finley_Mesh* in, bool_t useLinear);
00140
00141 void Finley_Mesh_optimizeDOFLabeling(Finley_Mesh*,dim_t *);
00142
00143
00144 Finley_Mesh* Finley_Mesh_merge(dim_t, Finley_Mesh**);
00145
00146 void Finley_Mesh_relableElementNodes(int*,int,Finley_Mesh*);
00147 void Finley_Mesh_markNodes(int*,int,Finley_Mesh*,int);
00148
00149 void Finley_Mesh_glueFaces(Finley_Mesh* self,double safety_factor,double tolerance, bool_t);
00150 void Finley_Mesh_joinFaces(Finley_Mesh* self,double safety_factor,double tolerance, bool_t);
00151
00152 int Finley_Mesh_findMatchingFaces_compar(const void*,const void*);
00153 void Finley_Mesh_findMatchingFaces(Finley_NodeFile*,Finley_ElementFile *,double,double, int*, int*,int*,int*);
00154 void Finley_Mesh_print(Finley_Mesh *in);
00155 void Finley_Mesh_saveDX(const char * filename_p, Finley_Mesh *mesh_p, const dim_t num_data,char* *names_p,escriptDataC* *data_pp);
00156 void Finley_Mesh_optimizeNodeLabeling(Finley_Mesh* mesh_p);
00157 dim_t Finley_Mesh_FindMinDegreeNode(Paso_SystemMatrixPattern* pattern_p,index_t* available,index_t indicator);
00158 index_t Finley_Mesh_getDegree(Paso_SystemMatrixPattern* pattern_p, index_t *label);
00159
00160
00161 void Finley_Mesh_saveVTK(const char * filename_p, Finley_Mesh *mesh_p, const dim_t num_data,char* *names_p,escriptDataC* *data_pp, const char* metadata, const char*metadata_schema);
00162 void Finley_Mesh_setTagsInUse(Finley_Mesh* in);
00163
00164 int Finley_Mesh_getStatus(Finley_Mesh* in);
00165
00166 #endif
00167