ESYS13
Revision_
|
00001 00002 /******************************************************* 00003 * 00004 * Copyright (c) 2003-2012 by University of Queensland 00005 * Earth Systems Science Computational Center (ESSCC) 00006 * http://www.uq.edu.au/esscc 00007 * 00008 * Primary Business: Queensland, Australia 00009 * Licensed under the Open Software License version 3.0 00010 * http://www.opensource.org/licenses/osl-3.0.php 00011 * 00012 *******************************************************/ 00013 00014 00015 #ifndef INC_FINLEY_NODEFILE 00016 #define INC_FINLEY_NODEFILE 00017 00018 #define MAX_numDim 3 00019 00020 #include "Finley.h" 00021 #include "NodeMapping.h" 00022 #include "escript/DataC.h" 00023 #include "paso/Distribution.h" 00024 #include "paso/Coupler.h" 00025 #include "esysUtils/Esys_MPI.h" 00026 00027 struct Finley_NodeFile { 00028 Esys_MPIInfo *MPIInfo; /* MPI information */ 00029 00030 dim_t numNodes; /* number of nodes */ 00031 dim_t numDim; /* spatial dimension */ 00032 index_t *Id; /* Id[i] is the id number of node i. It needs to be unique. */ 00033 index_t *Tag; /* Tag[i] is the tag of node i. */ 00034 index_t *tagsInUse; /* array of tags which are actually used */ 00035 dim_t numTagsInUse; /* number of tags used */ 00036 00037 index_t* globalDegreesOfFreedom; /* globalDegreesOfFreedom[i] is the global degree of freedom assigned to node i */ 00038 /* this index is used to consider periodic boundary conditions by assigning */ 00039 /* the same degreesOfFreedom to the same node */ 00040 double *Coordinates; /* Coordinates[INDEX2(k,i,numDim)] is the k-th coordinate of the */ 00041 /* node i. */ 00042 index_t *globalReducedDOFIndex; /* assigns each local node a global unique Id in a dense labeling of reduced DOF*/ 00043 /* value <0 indicates that the DOF is not used */ 00044 index_t *globalReducedNodesIndex; /* assigns each local node a global unique Id in a dense labeling */ 00045 /* value <0 indicates that the DOF is not used */ 00046 index_t *globalNodesIndex; /* assigns each local reduced node a global unique Id in a dense labeling */ 00047 00048 00049 Finley_NodeMapping *nodesMapping; 00050 Finley_NodeMapping *reducedNodesMapping; 00051 Finley_NodeMapping *degreesOfFreedomMapping; 00052 Finley_NodeMapping *reducedDegreesOfFreedomMapping; 00053 00054 Paso_Distribution *nodesDistribution; 00055 Paso_Distribution *reducedNodesDistribution; 00056 Paso_Distribution *degreesOfFreedomDistribution; 00057 Paso_Distribution *reducedDegreesOfFreedomDistribution; 00058 00059 Paso_Connector* degreesOfFreedomConnector; 00060 Paso_Connector *reducedDegreesOfFreedomConnector; 00061 00062 /* these are the packed versions of Id */ 00063 index_t *reducedNodesId; 00064 index_t *degreesOfFreedomId; 00065 index_t *reducedDegreesOfFreedomId; 00066 00067 00068 int status; /* the status counts the updates done on the node coordinates */ 00069 /* the value of status is increased by 1 when the node coordinates are updated.*/ 00070 }; 00071 00072 typedef struct Finley_NodeFile Finley_NodeFile; 00073 00074 00075 00076 Finley_NodeFile* Finley_NodeFile_alloc(dim_t, Esys_MPIInfo *MPIInfo); 00077 index_t Finley_NodeFile_getFirstReducedNode(Finley_NodeFile* in); 00078 index_t Finley_NodeFile_getLastReducedNode(Finley_NodeFile* in); 00079 dim_t Finley_NodeFile_getGlobalNumReducedNodes(Finley_NodeFile* in); 00080 index_t* Finley_NodeFile_borrowGlobalReducedNodesIndex(Finley_NodeFile* in); 00081 index_t Finley_NodeFile_maxGlobalNodeIDIndex(Finley_NodeFile* in); 00082 index_t Finley_NodeFile_maxGlobalReducedNodeIDIndex(Finley_NodeFile* in); 00083 index_t Finley_NodeFile_GlobalDegreeOfFreedomIndex(Finley_NodeFile* in); 00084 index_t Finley_NodeFile_GlobalReducedDegreeOfFreedomIndex(Finley_NodeFile* in); 00085 00086 index_t Finley_NodeFile_getFirstNode(Finley_NodeFile* in); 00087 index_t Finley_NodeFile_getLastNode(Finley_NodeFile* in); 00088 dim_t Finley_NodeFile_getGlobalNumNodes(Finley_NodeFile* in); 00089 index_t* Finley_NodeFile_borrowGlobalNodesIndex(Finley_NodeFile* in); 00090 00091 /* returns the number of target */ 00092 dim_t Finley_NodeFile_getNumReducedNodes(Finley_NodeFile* in); 00093 dim_t Finley_NodeFile_getNumDegreesOfFreedom(Finley_NodeFile* in); 00094 dim_t Finley_NodeFile_getNumNodes(Finley_NodeFile* in); 00095 dim_t Finley_NodeFile_getNumReducedDegreesOfFreedom(Finley_NodeFile* in); 00096 00097 /* returns the mapping from local nodes to a target */ 00098 index_t* Finley_NodeFile_borrowTargetReducedNodes(Finley_NodeFile* in); 00099 index_t* Finley_NodeFile_borrowTargetDegreesOfFreedom(Finley_NodeFile* in); 00100 index_t* Finley_NodeFile_borrowTargetNodes(Finley_NodeFile* in); 00101 index_t* Finley_NodeFile_borrowTargetReducedDegreesOfFreedom(Finley_NodeFile* in); 00102 /* returns the mapping from target to the local nodes */ 00103 index_t* Finley_NodeFile_borrowReducedNodesTarget(Finley_NodeFile* in); 00104 index_t* Finley_NodeFile_borrowDegreesOfFreedomTarget(Finley_NodeFile* in); 00105 index_t* Finley_NodeFile_borrowNodesTarget(Finley_NodeFile* in); 00106 index_t* Finley_NodeFile_borrowReducedDegreesOfFreedomTarget(Finley_NodeFile* in); 00107 00108 void Finley_NodeFile_allocTable(Finley_NodeFile*,dim_t); 00109 void Finley_NodeFile_free(Finley_NodeFile*); 00110 void Finley_NodeFile_freeTable(Finley_NodeFile*); 00111 void Finley_NodeFile_setIdGlobalRange(index_t*,index_t*,Finley_NodeFile*); 00112 void Finley_NodeFile_setIdRange(index_t*,index_t*,Finley_NodeFile*); 00113 void Finley_NodeFile_setDOFGlobalRange(index_t*,index_t*,Finley_NodeFile*); 00114 void Finley_NodeFile_setDOFRange(index_t*,index_t*,Finley_NodeFile*); 00115 00116 00117 void Finley_NodeFile_setGlobalDOFRange(index_t*,index_t*,Finley_NodeFile*); 00118 void Finley_NodeFile_setGlobalIdRange(index_t*,index_t*,Finley_NodeFile*); 00119 index_t Finley_NodeFile_maxGlobalDegreeOfFreedomIndex(Finley_NodeFile*); 00120 index_t Finley_NodeFile_maxGlobalReducedDegreeOfFreedomIndex(Finley_NodeFile*); 00121 00122 void Finley_NodeFile_setReducedDOFRange(index_t*,index_t*,Finley_NodeFile*); 00123 dim_t Finley_NodeFile_createDenseDOFLabeling(Finley_NodeFile*); 00124 dim_t Finley_NodeFile_createDenseNodeLabeling(Finley_NodeFile* in, index_t* node_distribution, const index_t* dof_distribution); 00125 dim_t Finley_NodeFile_createDenseReducedNodeLabeling(Finley_NodeFile* in, index_t* reducedNodeMask); 00126 dim_t Finley_NodeFile_createDenseReducedDOFLabeling(Finley_NodeFile* in, index_t* reducedNodeMask); 00127 void Finley_NodeFile_assignMPIRankToDOFs(Finley_NodeFile* in,Esys_MPI_rank* mpiRankOfDOF, index_t *distribution); 00128 void Finley_NodeFile_gather(index_t*,Finley_NodeFile*,Finley_NodeFile*); 00129 void Finley_NodeFile_gather_global(index_t*,Finley_NodeFile*,Finley_NodeFile*); 00130 void Finley_NodeFile_gatherEntries(dim_t, index_t*, index_t, index_t, index_t*, index_t*, index_t*, index_t*, index_t*, index_t*, dim_t numDim, double*, double*); 00131 void Finley_NodeFile_copyTable(dim_t,Finley_NodeFile*,dim_t,dim_t,Finley_NodeFile*); 00132 void Finley_NodeFile_scatter(index_t*,Finley_NodeFile*,Finley_NodeFile*); 00133 void Finley_NodeFile_scatterEntries(dim_t, index_t*, index_t, index_t, index_t*, index_t*, index_t*, index_t*, index_t*, index_t*, dim_t numDim, double*, double*); 00134 void Finley_NodeFile_copyTable(dim_t,Finley_NodeFile*,dim_t,dim_t,Finley_NodeFile*); 00135 void Finley_NodeFile_setGlobalReducedDegreeOfFreedomRange(index_t* min_id,index_t* max_id,Finley_NodeFile* in); 00136 void Finley_NodeFile_setGlobalNodeIDIndexRange(index_t* min_id,index_t* max_id,Finley_NodeFile* in); 00137 void Finley_NodeFile_setGlobalReducedNodeIDIndexRange(index_t* min_id,index_t* max_id,Finley_NodeFile* in); 00138 00139 /* ===================== */ 00140 void Finley_NodeFile_setCoordinates(Finley_NodeFile*,escriptDataC*); 00141 void Finley_NodeFile_setTags(Finley_NodeFile*,const int,escriptDataC*); 00142 void Finley_NodeFile_setTagsInUse(Finley_NodeFile* in); 00143 00144 #endif 00145