00001 #ifndef PARTOPJK_H 00002 #define PARTOPJK_H 00003 00004 #include <stdio.h> 00005 #include <mpi.h> 00006 #include "../GEFEL/galias.h" 00007 #include "../GEFEL/gtopology.h" 00008 00009 class psolver; 00010 00011 /** 00012 JK, huge revision 22.8.2011 00013 */ 00014 class partopjk 00015 { 00016 public: 00017 /// constructor 00018 partopjk (int np,int mr,meshdescription meshd,char *nameproc, int nl); 00019 /// destructor 00020 ~partopjk (); 00021 00022 /// function assembles the array nnsd which contains the numbers of nodes on subdomains 00023 void numbers_of_nodes_on_subdomains (gtopology *top,long *domproc,FILE *out); 00024 00025 /// function assembles the array mltg on the master which stores all ltg arrays from processors 00026 void ltg_on_master (long *ltg,long *domproc,FILE *out); 00027 00028 /// function converts any mesh description to the all_nodes mesh description 00029 void ltg_conversion (long *ltg,long *domproc,FILE *out,char *proc_name); 00030 00031 /// function assembles array nodmultip which contains nodal multiplicity 00032 void node_multiplicity (FILE *out); 00033 00034 /// function assembles array noddom 00035 void node_domain (FILE *out); 00036 00037 /// function assembles array ndofnm which contains the number of DOFs for each node 00038 void ndofn_on_master (gtopology *top,long *domproc,FILE *out); 00039 00040 /// function assembles array dofm which contains DOF indicators on each node 00041 void dof_on_master (gtopology *top,long *domproc,FILE *out); 00042 00043 /// function detects coupled DOFs in the problem 00044 void coupled_dofs_detection (FILE *out); 00045 00046 /// function detects internal and boundary/interface nodes 00047 void internal_boundary_nodes_detection (FILE *out); 00048 00049 /// function assembles ordering of unknowns on subdomains 00050 long schur_local_ordering (gtopology *top,FILE *out); 00051 00052 /// function assembles ordering of the coarse problem with respect to the Schur complement method 00053 void schur_coarse_ordering (FILE *out); 00054 00055 /// function assembles coarse code numbers for particular subdomains 00056 void coarse_code_numbers (FILE *out); 00057 00058 00059 // to se pak smaze 00060 long vse (long *ltg,gtopology *top,long *domproc,FILE *out,char *proc_name); 00061 00062 00063 /// FETI 00064 /// function assembles array fullnoddom 00065 void full_node_domain (FILE *out); 00066 00067 /// FETI 00068 /// function generates Lagrange multipliers 00069 void lagrange_multipliers (psolver ps,FILE *out); 00070 00071 /// FETI 00072 /// function assembles coarse code numbers for particular subdomains 00073 void coarse_code_numbers_feti (psolver ps,FILE *out); 00074 00075 00076 00077 00078 /// the number of processors 00079 /// determined in the constructor 00080 int nproc; 00081 /// rank of processor (processor id) 00082 /// determined in the constructor 00083 int myrank; 00084 /// mesh description 00085 /// md = 1 - all nodes have their global node number 00086 /// md = 2 - only boundary nodes have coarse number, internal nodes are denoted by -1 00087 /// md = 3 - all nodes have their global node number, boundary nodes have their global number multiplied by -1 00088 /// determined in the constructor 00089 meshdescription md; 00090 /// name of processor 00091 char procName[MPI_MAX_PROCESSOR_NAME]; 00092 /// length of the processor name 00093 int nameLength; 00094 00095 /// the number of nodes on subdomain 00096 /// determined in the function numbers_of_nodes_on_subdomains 00097 long nn; 00098 /// the maximum number of nodes on subdomain 00099 /// determined in the function numbers_of_nodes_on_subdomains 00100 long maxnn; 00101 00102 /// the maximum number of DOFs on subdomains 00103 /// at the beginning, it contains the maximum number of possible DOFs 00104 /// later on, it may be reduced due to coupled DOFs, constraints, etc. 00105 /// it is determined in the function ndofn_on_master 00106 long maxndofd; 00107 00108 /// the number of internal nodes 00109 /// variable is defined in function internal_boundary_nodes_detection 00110 long nin; 00111 00112 /// the number of boundary/interface nodes on subdomain 00113 /// variable is determined in function internal_boundary_nodes_detection 00114 long nbn; 00115 00116 /// the number of internal DOFs on subdomain 00117 /// the variable is determined in the function schur_local_ordering 00118 long nidof; 00119 00120 /// the number of boundary/interface DOFs on subdomain 00121 /// the variable is determined in the function schur_local_ordering 00122 long nbdof; 00123 00124 /// the number of DOFs on subdomain 00125 /// the variable is determined in the function schur_local_ordering 00126 long ndof; 00127 00128 /// the maximum number of boundary/interface DOFs on subdomain 00129 /// the variable is determined in the function internal_boundary_nodes_detection 00130 long maxnbdofd; 00131 00132 00133 /// array containing boundary/interface nodes on subdomains 00134 /// it contains nbn components 00135 /// bnid[i]=j - the i-th boundary/interface node is the j-th in gtopology list 00136 /// array is allocated in function internal_boundary_nodes_detection 00137 long *bnid; 00138 00139 /// array containing internal nodes on subdomains 00140 /// it contains nin components 00141 /// inid[i]=j - the i-th internal node is the j-th in gtopology list 00142 /// array is allocated in function internal_boundary_nodes_detection 00143 long *inid; 00144 00145 /// array containing coarse code numbers of boundary/interface DOFs on subdomain 00146 /// it contains nbdof components 00147 /// bdof[i]=j - the i-th boundary/interface DOF has the coarse code number j 00148 /// it is allocated and assembled in the function coarse_code_numbers 00149 long *bdof; 00150 00151 // ************************************************************* 00152 // variables and arrays located only on the master processor 00153 // ************************************************************* 00154 00155 /// the total number of nodes in the whole problem 00156 /// it is determined in the function ltg_conversion 00157 long tnnp; 00158 00159 /// the number of DOFs in the coarse problem 00160 /// it is determined in the function schur_coarse_ordering for the Schur complement method 00161 /// it is determined in the function lagrange_multipliers for the FETI method 00162 long ndofc; 00163 00164 /// array containing the numbers of nodes on subdomains 00165 /// it contains nproc components 00166 /// nnsd[i]=j - the i-th subdomain contains j nodes 00167 /// it is allocated and assembled in the function numbers_of_nodes_on_subdomains 00168 long *nnsd; 00169 00170 /// array of local to global correspondence on the master 00171 /// it contains nproc rows and nnsd[i] columns 00172 /// mltg[i][j]=k - the j-th node on the i-th subdomain has global number k 00173 /// it is allocated and assembled in the function ltg_on_master 00174 long **mltg; 00175 00176 /// array of nodal multiplicity, the multiplicity is the number of 00177 /// subdomains which share the node 00178 /// it contains tnnp components 00179 /// nodmultip[i]=j - the i-th node (in global ordering) is shared by j subdomains 00180 /// it is assembled in the function node_multiplicity 00181 long *nodmultip; 00182 00183 /// array of node-domain correspondence 00184 /// it contains tnnp components 00185 /// noddom[i]=j - the i-th node belongs to the j-th subdomain 00186 /// it is assembled in the function node_domain 00187 /// it is used for detection of coupled DOFs in the Schur complement method 00188 /// only nodes on different subdomains are taken into account, therefore it 00189 /// is enough to allocate only one number for each node 00190 long *noddom; 00191 00192 /// array of numbers of DOFs on nodes 00193 /// it contains tnnp components 00194 /// ndofnm[i]=j - the i-th node contains j DOFs 00195 /// it is assembled in the function ndofn_on_master 00196 long *ndofnm; 00197 00198 /// array of DOF indicators on nodes 00199 /// it contains tnnp rows and ndofnm[i] columns 00200 /// dofm[i][j]=k - the j-th DOF on the i-th node has id equal to k 00201 /// it is assembled in the function dof_on_master 00202 long **dofm; 00203 00204 /// array containing the numbers of boundary/interface nodes on subdomains 00205 /// it contains nproc components 00206 /// nbnd[i]=j - the i-th domain contains j boundary/interface nodes 00207 /// array is allocated in function internal_boundary_nodes_detection 00208 long *nbnd; 00209 00210 /// array containing the numbers of internal nodes on subdomains 00211 /// it contains nproc components 00212 /// nind[i]=j - the i-th domain contains j internal nodes 00213 /// array is allocated in function internal_boundary_nodes_detection 00214 long *nind; 00215 00216 /// array containing the numbers of boundary/interface DOFs on subdomains 00217 /// it contains nproc components 00218 /// nbdofd[i]=j - the i-th subdomain contains j boundary/interface DOFs 00219 /// array is allocated in the function coarse_code_numbers 00220 long *nbdofd; 00221 00222 /// array containing coarse code numbers of boundary/interface DOFs on subdomains 00223 /// it contains nproc rows and nbdofd[i] columns 00224 /// bdofd[i][j]=k - the j-th boundary/interface DOF on the i-th subdomain has the coarse code number k 00225 /// it is allocated and assembled in the function coarse_code_numbers 00226 long **bdofd; 00227 00228 00229 /// FETI 00230 /// array of full node-domain correspondence 00231 /// it contains tnnp rows and nodmultip[i] columns 00232 /// fullnoddom[i][j]=k - the j-th subdomain which shares the i-th node has number (id) k 00233 /// it is assembled in the function full_node_domain 00234 long **fullnoddom; 00235 00236 /// FETI 00237 /// array of Lagrange multipliers, it contains coarse code numbers 00238 /// it contains tnnp rows and nc columns 00239 /// nc is either (nodmultip[i]-1)*ndofnm[i] or nodmultip[i]*(nodmultip[i]-1)/2*ndofnm[i] 00240 /// lagrmultip[i][j]=k - the j-th Lagrange multiplier in the i-th node has coarse number k 00241 long **lagrmultip; 00242 00243 }; 00244 00245 00246 #endif