Changeset 17171
- Timestamp:
- 01/24/14 15:57:39 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp
r17159 r17171 15 15 /*}}}*/ 16 16 void ExtrapolationAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/ 17 int stabilization,finiteelement;17 int finiteelement; 18 18 19 19 /*Finite element type*/ … … 83 83 IssmDouble dlevelset[dim],normal[dim]; 84 84 IssmDouble norm_dlevelset; 85 IssmDouble hx,hy,hz,kappa; 85 86 IssmDouble* xyz_list = NULL; 86 87 … … 101 102 /* Start looping on the number of gaussian points: */ 102 103 Gauss* gauss=element->NewGauss(2); 103 for(int ig=gauss->begin();ig<gauss->end();ig++){ 104 for(int ig=gauss->begin();ig<gauss->end();ig++){/*{{{*/ 104 105 gauss->GaussPoint(ig); 105 106 … … 128 129 &Ke->values[0],1); 129 130 131 /* Stabilization *//*{{{*/ 130 132 stabilization=1; 131 133 if (stabilization==0){/* no stabilization, do nothing*/} 132 134 else if(stabilization==1){ 133 /*Streamline upwinding*/ 134 for(row=0;row<dim;row++) 135 for(col=0;col<dim;col++) 136 D[row][col]=h/(2.*1.)*normal[row]*normal[col]; 137 135 /* Artificial Diffusion */ 136 element->ElementSizes(&hx,&hy,&hz); 137 h=sqrt( pow(hx*normal[0],2) + pow(hy*normal[1],2)); 138 kappa=h/2.; 139 D[0][0]=D_scalar*kappa; 140 D[0][1]=0.; 141 D[1][0]=0.; 142 D[1][1]=D_scalar*kappa; 138 143 TripleMultiply(Bprime,dim,numnodes,1, 139 144 &D[0][0],dim,dim,0, … … 141 146 &Ke->values[0],1); 142 147 } 143 } 148 else if(stabilization==2){ 149 /*Streamline upwinding - do not use this for extrapolation: yields oscillating results due to smoothing along normal, not across */ 150 for(row=0;row<dim;row++) 151 for(col=0;col<dim;col++) 152 D[row][col]=h/(2.*1.)*normal[row]*normal[col]; 153 154 TripleMultiply(Bprime,dim,numnodes,1, 155 &D[0][0],dim,dim,0, 156 Bprime,dim,numnodes,0, 157 &Ke->values[0],1); 158 }/*}}}*/ 159 }/*}}}*/ 144 160 145 161 /*Clean up and return*/ … … 150 166 return Ke; 151 167 152 168 }/*}}}*/ 153 169 ElementVector* ExtrapolationAnalysis::CreatePVector(Element* element){/*{{{*/ 154 170
Note:
See TracChangeset
for help on using the changeset viewer.