00001 #include "flsubdom.h" 00002 #include "gtopology.h" 00003 #include "global.h" 00004 #include "gmatrix.h" 00005 00006 flsubdom::flsubdom () 00007 { 00008 // the number of changes 00009 nch=0; 00010 // array of Lagrange multipliers 00011 lambda = NULL; 00012 // array of total Lagrange multipliers 00013 totlambda = NULL; 00014 // array of compliances 00015 compli=NULL; 00016 } 00017 00018 flsubdom::~flsubdom () 00019 { 00020 delete [] lambda; 00021 delete [] totlambda; 00022 delete [] compli; 00023 } 00024 00025 /** 00026 function initializes variables and arrays 00027 00028 JK, 3. 8. 2012 00029 */ 00030 void flsubdom::initiation (gmatrix *gm,FILE *out) 00031 { 00032 Mp->ssle->feti.matrices_assembl (gm,out); 00033 } 00034 00035 00036 /** 00037 function solves system of linear algebraic equations 00038 by the modified conjugate gradient method 00039 Lagrange multipliers are computed first and then displacements are obtained 00040 for more details see Kruis: Domain Decomposition Methods for 00041 Distributed Computing. Saxe-Coburg, 2006. 00042 00043 @param lhs - left hand side %vector (%vector of nodal unknowns) 00044 @param rhs - right hand side 00045 00046 JK, 20.6.2006, modified 2.8.2012 00047 */ 00048 void flsubdom::solve_lin_alg_system (double *lhs,double *rhs,FILE *out) 00049 { 00050 // assembling of the vectors of the right hand side for each subdomain 00051 Mp->ssle->feti.assemble_ff (rhs); 00052 00053 // assembling of the e vector 00054 Mp->ssle->feti.evector (out); 00055 00056 // preconditioned modified conjugate gradient method 00057 Mp->ssle->feti.mpcg (out); 00058 00059 // computation of nodal unknowns from Lagrange multipliers 00060 Mp->ssle->feti.nodalunknowns (lhs,out); 00061 } 00062 00063 /** 00064 function adds increments of Lagrange multipliers to 00065 the %vector of total multipliers in nonlinear problems 00066 00067 @param dlambda - increment from arclength method 00068 00069 JK, 22.6.2006 00070 */ 00071 /* 00072 void flsubdom::add_mult (double dlambda) 00073 { 00074 long i; 00075 00076 //for (i=0;i<nlm;i++){ 00077 //tw[i]+=dlambda*w[i]; 00078 //} 00079 00080 for (i=0;i<nlm;i++){ 00081 w[i]*=dlambda; 00082 tw[i]+=w[i]; 00083 } 00084 } 00085 */ 00086 /** 00087 function corrects Lagrange multipliers with respect to 00088 defined law 00089 00090 JK, 24.6.2006 00091 */ 00092 /* 00093 void flsubdom::mult_correction () 00094 { 00095 long i; 00096 00097 //cv = new double [nlm]; 00098 //Gtm->flsub.local_coarse (cv,Lsrs->lhs); 00099 00100 nch=0; 00101 for (i=0;i<nlm;i++){ 00102 00103 if (tw[i]>1.0 && tw[i]<-1.0){ 00104 compli[i]=5.0; 00105 } 00106 00107 */ 00108 /* 00109 if (mu[i]>100.0){ 00110 //tw[i]=10.0; 00111 //compli[i]=20000.0; 00112 //compli[i]=2.0; 00113 compli[i]=(mu[i]-100.0)/10000.0; 00114 nch++; 00115 } 00116 */ 00117 /* 00118 if (tw[i]>10.0 && cv[i]<10.0){ 00119 //tw[i]=10.0; 00120 //compli[i]=20000.0; 00121 compli[i]=2.0; 00122 //compli[i]=tw[i]-10.0; 00123 nch++; 00124 } 00125 if (tw[i]>10.0 && cv[i]>10.0){ 00126 //tw[i]=10.0; 00127 compli[i]=20000.0; 00128 //compli[i]=2.0; 00129 //compli[i]=tw[i]-10.0; 00130 nch++; 00131 } 00132 */ 00133 /* 00134 if (tw[i]>100.0) 00135 tw[i]=100.0; 00136 */ 00137 00138 /* 00139 } 00140 00141 //delete [] cv; 00142 } 00143 00144 */