00001 #ifndef SEQTOP_H 00002 #define SEQTOP_H 00003 00004 #include <stdio.h> 00005 #include "galias.h" 00006 #include "xfile.h" 00007 00008 class gtopology; 00009 00010 /** 00011 class imitates the class partop which deals with topology in parallel computations 00012 it is sequential version of the class partop and it is developed 00013 for simpler manipulation and possible application of debugger 00014 00015 00016 notation: 00017 00018 node multiplicity - number of subdomains which share the node 00019 00020 internal node - node with multiplicity 1, (node inside a subdomain, 00021 node not lying on inter-subdomain boundary) 00022 00023 interface node - node with multiplicity at least 2, (node lying 00024 on inter-subdomain boundary) 00025 00026 coarse node - artificial node defined on master which collects appropriate 00027 interface nodes 00028 00029 00030 global ordering - node ordering before mesh partitioning 00031 global node numbers - node numbers used in undecomposed mesh 00032 (node numbers used before decomposition/partitioning) 00033 00034 local ordering - ordering of subdomains (without respect to remaining subdomains) 00035 local node numbers - node numbers used in decomposed mesh 00036 (node numbers used after decomposition/partitioning) 00037 00038 coarse ordering - ordering of interface nodes only 00039 coarse node number - node numbers of interface nodes only, ordering 00040 of all interface nodes in coarse problem 00041 00042 00043 mesh description: 00044 md = bound_nodes = 1 - all nodes have their global node number 00045 md = all_nodes = 2 - only interface nodes have coarse number, internal nodes are denoted by -1 00046 md = neg_bound_nodes = 3 - all nodes have their global node number, interface nodes have their global number multiplied by -1 00047 00048 JK, 11.9.2007 00049 */ 00050 class seqtop 00051 { 00052 public: 00053 seqtop(long nd,meshdescription meshd); 00054 ~seqtop (); 00055 00056 void read_nnsd (XFILE *in); 00057 //void read_nesd (XFILE *in); 00058 void read_ltg (XFILE *in); 00059 //void read_eltg (XFILE *in); 00060 void read_eldom (long ne,XFILE *in); 00061 00062 void assemble_multip (FILE *out); 00063 void coupled_dofs (gtopology *top,FILE *out); 00064 void update_multip (gtopology *top,FILE *out); 00065 void assemble_nbnd_nind (FILE *out); 00066 void assemble_nodmultip (FILE *out); 00067 void assemble_dofind (gtopology *top,FILE *out); 00068 void compute_multiplicity (gtopology *top,FILE *out); 00069 00070 //void compute_multiplicity (FILE *out); 00071 //void find_boundary_nodes (FILE *out); 00072 00073 void node_local_numbers (FILE *out); 00074 void node_global_glued_numbers (FILE *out); 00075 void node_coarse_numbers (FILE *out); 00076 void node_coarse_local_map (FILE *out); 00077 void node_coarse_global_glued_map (FILE *out); 00078 00079 long schur_ordering (gtopology *top,FILE *out); 00080 long schur_ordering_old (gtopology *top,FILE *out); 00081 00082 void coarse_local_map (gtopology *top,FILE *out); 00083 00084 // function assembles lists of elements belonging to subdomains 00085 void elem_lists (); 00086 00087 00088 //void rewrite_ltg (); 00089 //void codnum_renumb (gtopology *top); 00090 00091 //void ndofn_list (gtopology *top); 00092 //void dof_list (gtopology *top); 00093 //void bdof_numbers (gtopology *top); 00094 //void bdof_list (gtopology *top); 00095 00096 //void create_ltg (gtopology *gt,FILE *out); 00097 //void ltg1array (long n,long *aux); 00098 //void readltg1 (long n,XFILE *in); 00099 00100 /// number of subdomains 00101 /// it is determined in the constructor 00102 long ns; 00103 /// total number of nodes in the whole problem 00104 /// this number cannot be obtained in the case of mesh description = bound_nodes 00105 /// this number is determined in the function compute_multiplicity 00106 long tnnp; 00107 /// total number of interface (boundary) nodes 00108 /// this number is determined in the function compute_multiplicity 00109 long tnbn; 00110 /// number of nodes in the class gtopology 00111 /// this number is not equal to tnnp 00112 /// the number is determined in the function coupled_dofs 00113 long nn; 00114 /// total number of all elements in the problem 00115 long tnep; 00116 00117 /// mesh description 00118 /// it is determined in the constructor 00119 meshdescription md; 00120 00121 /// array containing number of nodes on subdomains 00122 /// it contains ns components 00123 /// nnsd[i]=j - j nodes are defined on the i-th subdomain 00124 /// array is read in the function read_nnsd (XFILE *in) 00125 long *nnsd; 00126 00127 /// array containing list of numbers of boundary/interface nodes on subdomains 00128 /// it contains ns components 00129 /// nbnd[i]=j - the i-th domain contains j boundary/interface nodes 00130 /// array is assembled in the function compute_multiplicity (FILE *out) 00131 long *nbnd; 00132 00133 /// array containing list of numbers of internal nodes on subdomains 00134 /// it contains ns components 00135 /// nind[i]=j - the i-th domain contains j internal nodes 00136 /// array is assembled in the function compute_multiplicity (FILE *out) 00137 long *nind; 00138 00139 /// array containing number of subdomains which each node belongs to 00140 /// it contains tnnp components, 00141 /// amultip[i]=j - the i-th node belongs to j subdomains 00142 /// array is assembled in the function assemble_multip (FILE *out) 00143 long *amultip; 00144 00145 /// array containing number of subdomains which each boundary/interface node belongs to 00146 /// it contains tnbn components, 00147 /// bmultip[i]=j - the i-th interface/boundary node belongs to j subdomains 00148 /// array is assembled in the function assemble_multip (FILE *out) 00149 long *bmultip; 00150 00151 /// array containing number of subdomains which share the nodes 00152 /// it contains ns, nnsd[i] components 00153 /// nodmultip[i][j]=k - the j-th node of the i-th subdomain belongs to k subdomains 00154 /// array is assembled in the function update_multip (gtopology *top,FILE *out) or assemble_nodmultip (FILE *out) 00155 long **nodmultip; 00156 00157 /// local to global correspondence 00158 /// ltg[i][j]=k - the j-th node on the i-th subdomain has global/coarse number k 00159 /// if mesh description is bound_nodes: 00160 /// k>-1 - coarse number of the node 00161 /// k=-1 - the node is internal node 00162 /// if mesh description is all_nodes: 00163 /// k is the global number of the node 00164 long **ltg; 00165 00166 /// array containing the number of elements on subdomains 00167 /// it has ns components 00168 /// ned[i]=j - there are j elements on the i-th subdomain 00169 /// array is allocated and assembled in function elem_lists 00170 long *ned; 00171 00172 /// element-domain correspondence 00173 /// eldom[i]=j - the i-th element belongs to the j-th subdomain/aggregate 00174 long *eldom; 00175 00176 /// domain-element correspondence 00177 /// it has ns rows and ned[i] columns 00178 /// domel[i][j]=k - the j-th element on the i-th subdomain has number k 00179 long **domel; 00180 00181 /// array containing local numbers of interface/boundary nodes 00182 /// it contains ns, nbnd[i] components 00183 /// lnbn[i][j]=k - the j-th boundary node on the i-th subdomain has local number k 00184 /// array is allocated in the function node_local_numbers 00185 long **lnbn; 00186 00187 /// array containing local numbers of internal nodes 00188 /// it contains ns, nind[i] components 00189 /// lnin[i][j]=k - the j-th internal node on the i-th subdomain has local number k 00190 /// array is allocated in the function node_local_numbers 00191 long **lnin; 00192 00193 /// array containing global glued numbers of boundary/interface nodes 00194 /// it contains ns, nbnd[i] components 00195 /// ggnbn[i][j]=k - the j-th boundary/interface node on the i-th subdomain has global glued number k 00196 /// array is allocated in the function node_global_glued_numbers 00197 long **ggnbn; 00198 00199 /// array containing global glued numbers of internal nodes 00200 /// it contains ns, nind[i] components 00201 /// ggnin[i][j]=k - the j-th internal node on the i-th subdomain has global glued number k 00202 /// array is allocated in the function node_global_glued_numbers 00203 long **ggnin; 00204 00205 /// array containing coarse numbers of interface/boundary nodes 00206 /// it contains ns, nbnd[i] components 00207 /// icnbnmas[i][j]=k - the j-th boundary node on the i-th subdomain has coarse number k 00208 /// array is allocated in the function node_coarse_numbers 00209 long **icnbnmas; 00210 00211 /// array containing node multiplicity of boundary/interface nodes 00212 /// it contains tnbn components 00213 /// icmultip[i]=j - the i-th boundary/interface node belongs to j subdomains 00214 /// array is allocated in the function node_coarse_numbers 00215 long *icmultip; 00216 00217 00218 /// local numbers of boundary/interface nodes appropriate to coarse node 00219 /// it contains local numbers of boundary/interafce nodes of each coarse node 00220 /// it contains tnbn rows and icmultip[i] columns 00221 /// lnbncn[i][j]=k - the j-th node shared by the i-th coarse node has local number k 00222 /// aray is allocated in the function node_coarse_local_map 00223 long **lnbncn; 00224 00225 /// global glued numbers of boundary/interface nodes appropriate to coarse node 00226 /// it contains global glued numbers of boundary/interafce nodes of each coarse node 00227 /// it contains tnbn rows and icmultip[i] columns 00228 /// ggnbncn[i][j]=k - the j-th node shared by the i-th coarse node has global glued number k 00229 /// aray is allocated in the function node_coarse_global_glued_map 00230 long **ggnbncn; 00231 00232 /// subdomain id of interface/boundary nodes appropriate to coarse node 00233 /// it contains tnbn rows and icmultip[i] columns 00234 /// sid[i][j]=k - the j-th node shared by the i-th coarse node belongs to the k-th subdomain 00235 /// array is allocated in the function node_coarse_local_map or node_coarse_global_glued_map 00236 long **sid; 00237 00238 00239 /// the number of coupled DOFs 00240 /// it is determined in the function coupled_dofs 00241 long ncdof; 00242 00243 /// array containing indicators of coupled DOFs 00244 /// it has ns, ncdof components 00245 /// coupdof[i][j]=k - the j-th coupled DOFs on the i-th subdomain is shared by k nodes 00246 /// array is allocated in the function coupled_dofs 00247 long **coupdof; 00248 00249 /// array containing suspicious indicators of coupled DOFs 00250 /// it has ncdof components 00251 /// coupdofmas[i]=0 - the i-th coupled DOF is not a boundary/interface DOF 00252 /// coupdofmas[i]=1 - the i-th coupled DOF is a boundary/interface DOF 00253 /// array is allocated in the function coupled_dofs 00254 long *coupdofmas; 00255 00256 00257 /// array containing DOF indicators 00258 /// if there are coupled DOFs, it is not enough to deal with nodes 00259 /// DOFs have to be split to internal and boundary/interface 00260 /// it has nn, ndofn[i] components (nn is the total number of nodes, gt->nn) 00261 /// dofind[i][j]=0 - the j-th DOF in the i-th node is internal 00262 /// dofind[i][j]=1 - the j-th DOF in the i-th node is boundary/interface 00263 /// array is allocated in the function update_multiplicity 00264 long **dofind; 00265 00266 00267 }; 00268 00269 #endif